gwnavruntime/queries/utils/basemoveonnavmeshquery.h Source File

basemoveonnavmeshquery.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: LAPA - secondary contact: JUBA
9 #ifndef Navigation_BaseMoveOnNavMeshQuery_H
10 #define Navigation_BaseMoveOnNavMeshQuery_H
11 
15 
16 namespace Kaim
17 {
18 
19 class Path;
20 
23 {
26 
32 
36 };
37 
38 class BaseMoveOnNavMeshQuery : public IAtomicQuery
39 {
40 public:
41  static QueryType GetStaticType() { return TypeMoveOnNavMesh; }
42  virtual QueryType GetType() const { return TypeMoveOnNavMesh; }
43 
44  // ---------------------------------- Main API Functions ----------------------------------
45 
46  MoveOnNavMeshQueryResult GetResult() const;
47  const Vec3f& GetStartPos() const;
48  const Vec3f& GetArrivalPos() const;
49  const Vec2f& GetNormalizedDir2d() const;
50  const NavTrianglePtr& GetStartTrianglePtr() const;
51  KyFloat32 GetDistanceToBoundary() const;
52  KyFloat32 GetDistance() const;
53  KyFloat32 GetAltitudeTolerance() const;
54  const WorldIntegerPos& GetStartIntegerPos() const;
55 
56 public: //internal
57  void BindToDatabase(Database* database);
58  void Initialize(const Vec3f& startPos, const Vec2f& normalizedDir2d, KyFloat32 maxDist);
59  void SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr);
60  void SetDistanceToBoundary(KyFloat32 distanceToBoundary);
61  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
62 
63 protected:
64  BaseMoveOnNavMeshQuery();
65  virtual ~BaseMoveOnNavMeshQuery() {}
66  void SetResult(MoveOnNavMeshQueryResult result);
67 
68 protected:
69  WorldIntegerPos m_startIntegerPos;
70 
71  Vec3f m_startPos3f;
72  Vec2f m_normalizedDir2d;
73 
74  NavTrianglePtr m_startTrianglePtr;
75 
78  KyFloat32 m_distanceToBoundary;
79 
83  KyFloat32 m_moveDistance;
84 
89  Vec3f m_arrivalPos3f;
90 
91  MoveOnNavMeshQueryResult m_result;
92 
93 public:
94  bool m_visualDebugActivated;
95 };
96 
97 
98 
99 KY_INLINE void BaseMoveOnNavMeshQuery::SetStartIntegerPos(const WorldIntegerPos& startIntegerPos) { m_startIntegerPos = startIntegerPos; }
100 KY_INLINE void BaseMoveOnNavMeshQuery::SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr) { m_startTrianglePtr = startTrianglePtr; }
101 KY_INLINE void BaseMoveOnNavMeshQuery::SetDistanceToBoundary(KyFloat32 distanceToBoundary) { m_distanceToBoundary = distanceToBoundary; }
102 KY_INLINE void BaseMoveOnNavMeshQuery::SetResult(MoveOnNavMeshQueryResult result) { m_result = result; }
103 
104 KY_INLINE MoveOnNavMeshQueryResult BaseMoveOnNavMeshQuery::GetResult() const { return m_result; }
105 KY_INLINE const Vec3f& BaseMoveOnNavMeshQuery::GetStartPos() const { return m_startPos3f; }
106 KY_INLINE const Vec3f& BaseMoveOnNavMeshQuery::GetArrivalPos() const { return m_arrivalPos3f; }
107 KY_INLINE const Vec2f& BaseMoveOnNavMeshQuery::GetNormalizedDir2d() const { return m_normalizedDir2d; }
108 KY_INLINE const NavTrianglePtr& BaseMoveOnNavMeshQuery::GetStartTrianglePtr() const { return m_startTrianglePtr; }
109 KY_INLINE KyFloat32 BaseMoveOnNavMeshQuery::GetDistanceToBoundary() const { return m_distanceToBoundary; }
110 KY_INLINE KyFloat32 BaseMoveOnNavMeshQuery::GetDistance() const { return m_moveDistance; }
111 KY_INLINE const WorldIntegerPos& BaseMoveOnNavMeshQuery::GetStartIntegerPos() const { return m_startIntegerPos; }
112 }
113 
114 #endif //Navigation_BaseMoveOnNavMeshQuery_H
115 
Indicates that the start position is near an edge but should not be linked to it. This is usualy due ...
Definition: basemoveonnavmeshquery.h:29
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basemoveonnavmeshquery.h:27
Indicates that the query has not yet been launched.
Definition: basemoveonnavmeshquery.h:25
Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not consid...
Definition: basemoveonnavmeshquery.h:28
Indicates an arrival point was successfully calculated without a collision with the NavMesh border...
Definition: basemoveonnavmeshquery.h:33
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
Indicates that an unknown error occurred during the query processing.
Definition: basemoveonnavmeshquery.h:31
Indicates a collision point was found, and a final arrival position was successfully calculated...
Definition: basemoveonnavmeshquery.h:34
Definition: gamekitcrowddispersion.h:20
Indicates that insufficient memory was available to store crossed triangles or sub-sections, and the query failed as a result.
Definition: basemoveonnavmeshquery.h:30
MoveOnNavMeshQueryResult
Enumerates the possible results of a MoveOnNavMeshQuery.
Definition: basemoveonnavmeshquery.h:22
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
Indicates a collision point was found, an intermediary position has be found but progression has been...
Definition: basemoveonnavmeshquery.h:35
Indicates that the query has not yet been initialized.
Definition: basemoveonnavmeshquery.h:24
Indicates that the query has not yet been launched.
Definition: iquery.h:347
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
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43