gwnavruntime/queries/nearestborderhalfedgefromposquery.h Source File

nearestborderhalfedgefromposquery.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 
9 
10 // Primary contact: JUBA - secondary contact: NOBODY
11 #ifndef Navigation_NearestBorderHalfEdgeFromPosQuery_H
12 #define Navigation_NearestBorderHalfEdgeFromPosQuery_H
13 
21 
22 namespace Kaim
23 {
30 template<class TraverseLogic>
31 class NearestBorderHalfEdgeFromPosQuery : public BaseNearestBorderHalfEdgeFromPosQuery
32 {
33 public:
34  // ---------------------------------- Public Member Functions ----------------------------------
35 
38 
39  // ---------------------------------- Functions to set up the query ----------------------------------
40 
44  void BindToDatabase(Database* database);
45 
50  void Initialize(const Vec3f& inputPos);
51 
52  // ---------------------------------- write accessors for query parameters ----------------------------------
53 
55  void SetHorizontalTolerance(KyFloat32 horizontalTolerance);
56 
58  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
59 
60  // ---------------------------------- Query framework functions ----------------------------------
61 
62  virtual void Advance(WorkingMemory* workingMemory);
63 
67  void PerformQuery(WorkingMemory* workingMemory = KY_NULL);
68 
69  // ---------------------------------- Accessors ----------------------------------
70 
72  const Vec3f& GetInputPos() const;
73  const Vec3f& GetNearestPosOnHalfEdge() const;
74  const NavHalfEdgePtr& GetNearestHalfEdgePtrOnBorder() const;
75  const NavHalfEdgePtr& GetNextHalfEdgePtrAlongBorder() const;
76  const NavHalfEdgePtr& GetPrevHalfEdgePtrAlongBorder() const;
77  KyFloat32 GetHorizontalTolerance() const;
78  KyFloat32 GetSquareDistFromNearestBorder() const;
79 
80  const PositionSpatializationRange& GetPositionSpatializationRange() const;
81 
82 public : // internal
83  void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
84  void SetInputIntegerPos(const WorldIntegerPos& inputIntegerPos);
85  const WorldIntegerPos& GetInputIntegerPos() const;
86  const WorldIntegerPos& GetNearestIntegerPosOnHalfEdge() const;
87 };
88 
89 
90 }
91 
93 
94 #endif //Navigation_NearestBorderHalfEdgeFromPosQuery_H
95 
#define KY_NULL
Null value.
Definition: types.h:247
void SetPositionSpatializationRange(const PositionSpatializationRange &positionSpatializationRange)
Write accessor for m_positionSpatializationRange.
Definition: nearestborderhalfedgefromposquery.inl:37
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
void PerformQuery(WorkingMemory *workingMemory=0)
Performs the query.
Definition: nearestborderhalfedgefromposquery.inl:114
void SetHorizontalTolerance(KyFloat32 horizontalTolerance)
Write accessor for m_horizontalTolerance.
Definition: nearestborderhalfedgefromposquery.inl:31
Definition: gamekitcrowddispersion.h:20
NearestBorderHalfEdgeFromPosQueryResult
Enumerates the possible results of a NearestBorderHalfEdgeFromPosQuery.
Definition: basenearestborderhalfedgefromposquery.h:29
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: nearestborderhalfedgefromposquery.inl:19
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
Each instance of this class uniquely identifies a single NavHalfEdge in a NavFloor.
Definition: navhalfedgeptr.h:19
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: nearestborderhalfedgefromposquery.inl:107
void Initialize()
Should be called by the derived class before trying to perform the query or to push it in a QueryQueu...
Definition: iquery.h:372
The NearestBorderHalfEdgeFromPosQuery class finds the NavMesh border nearest a specified 3D position ...
Definition: nearestborderhalfedgefromposquery.h:34
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23