gwnavruntime/queries/insideposfromoutsideposquery.h Source File

insideposfromoutsideposquery.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 // Primary contact: JUBA - secondary contact: NOBODY
9 #ifndef Navigation_InsidePosFromOutsidePosQuery_H
10 #define Navigation_InsidePosFromOutsidePosQuery_H
11 
16 
17 
18 namespace Kaim
19 {
20 
37 template<class TraverseLogic>
38 class InsidePosFromOutsidePosQuery : public BaseInsidePosFromOutsidePosQuery
39 {
40 public:
41  // ---------------------------------- Public Member Functions ----------------------------------
42 
44  virtual ~InsidePosFromOutsidePosQuery() {}
45 
46  // ---------------------------------- Functions to set up the query ----------------------------------
47 
51  void BindToDatabase(Database* database);
52 
58  void Initialize(const Vec3f& inputPos);
59 
65  void Initialize(const Vec3f& inputPos, const Vec2f& castDirection);
66 
67  // ---------------------------------- write accessors for query parameters ----------------------------------
68 
70  void SetHorizontalTolerance(KyFloat32 horizontalTolerance);
71 
73  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
74 
76  void SetDistFromObstacle(KyFloat32 distFromObstacle);
77 
78  // ---------------------------------- Query framework functions ----------------------------------
79 
80  virtual void Advance(WorkingMemory* workingMemory);
81 
85  void PerformQuery(WorkingMemory* workingMemory = KY_NULL);
86 
87  // ---------------------------------- Accessors ----------------------------------
88 
89  InsidePosFromOutsidePosQueryResult GetResult() const;
90  InsidePosFromOutsidePosQueryMode GetQueryMode() const;
91  const Vec3f& GetInputPos() const;
92  const Vec3f& GetInsidePos() const;
93  const Vec2f& GetCastDirection() const;
94  const NavTrianglePtr& GetInsidePosTrianglePtr() const;
95  KyFloat32 GetHorizontalTolerance() const;
96  KyFloat32 GetDistFromObstacle() const;
97 
98  const PositionSpatializationRange& GetPositionSpatializationRange() const;
99 
100 public : // internal
101  void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
102  void SetInputIntegerPos(const WorldIntegerPos& inputIntegerPos);
103  const WorldIntegerPos& GetInputIntegerPos() const;
104  const WorldIntegerPos& GetInsideIntegerPos() const;
105 
106 public: // internal
107  KyResult RetrieveNearestBorderHalfEdge(WorkingMemory* workingMemory, NavHalfEdgeRawPtr& borderHalfEdgerawPtr,
108  NavHalfEdgeRawPtr& prevBorderHalfEdgerawPtr, NavHalfEdgeRawPtr& nextBorderHalfEdgerawPtr, Vec3f& posOnBorderEdge,
109  WorldIntegerPos& integerPosOnBorderEdge);
110  KyResult RetrieveBorderHalfEdgeWithRayCast(WorkingMemory* workingMemory, NavHalfEdgeRawPtr& borderHalfEdgerawPtr,
111  NavHalfEdgeRawPtr& prevBorderHalfEdgerawPtr, NavHalfEdgeRawPtr& nextBorderHalfEdgerawPtr, Vec3f& posOnBorderEdge,
112  WorldIntegerPos& integerPosOnBorderEdge);
113 };
114 
115 }
116 
118 
119 
120 
121 #endif //Navigation_InsidePosFromOutsidePosQuery_H
122 
InsidePosFromOutsidePosQueryResult
Enumerates the possible results of an InsidePosFromOutsidePosQuery.
Definition: baseinsideposfromoutsideposquery.h:26
void SetPositionSpatializationRange(const PositionSpatializationRange &positionSpatializationRange)
Write accessor for m_positionSpatializationRange.
Definition: insideposfromoutsideposquery.inl:38
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
void PerformQuery(WorkingMemory *workingMemory=0)
Performs the query.
Definition: insideposfromoutsideposquery.inl:117
void SetHorizontalTolerance(KyFloat32 horizontalTolerance)
Write accessor for m_horizontalTolerance.
Definition: insideposfromoutsideposquery.inl:33
#define KY_NULL
Null value.
Definition: types.h:247
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: insideposfromoutsideposquery.inl:17
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
This class defines a two-dimensional vector whose coordinates are stored using floating-point numbers...
Definition: vec2f.h:24
Definition: gamekitcrowddispersion.h:20
void SetDistFromObstacle(KyFloat32 distFromObstacle)
Write accessor for m_distFromObstacle.
Definition: insideposfromoutsideposquery.inl:43
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 NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
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 InsidePosFromOutsidePosQuery class finds a valid position inside the boundaries of the NavMesh...
Definition: insideposfromoutsideposquery.h:42
Each instance of this class uniquely identifies a singleNavHalfEdge in a NavFloor.
Definition: navhalfedgerawptr.h:34
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: insideposfromoutsideposquery.inl:109
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