gwnavruntime/queries/raycangoquery.h Source File

raycangoquery.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_RayCanGoQuery_H
10 #define Navigation_RayCanGoQuery_H
11 
15 
16 namespace Kaim
17 {
18 
23 template<class TraverseLogic>
25 {
26 public:
27  // ---------------------------------- Public Member Functions ----------------------------------
28 
29  RayCanGoQuery();
30  virtual ~RayCanGoQuery() {}
31 
32  // ---------------------------------- Functions to set up the query ----------------------------------
33 
37  void BindToDatabase(Database* database);
38 
44  void Initialize(const Vec3f& startPos, const Vec3f& destPos);
45 
46  // ---------------------------------- write accessors for query inputs ----------------------------------
47 
51  void SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr);
52 
55  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
56 
57  // ---------------------------------- write accessors for query parameters ----------------------------------
58 
61  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
62 
65  void SetComputeCostMode(ComputeCostMode computeCostMode);
66 
69  void SetMarginMode(RayCanGoMarginMode marginMode);
70 
73  void SetDynamicOutputMode(DynamicOutputMode savingMode);
74 
75  // ---------------------------------- Query framework functions ----------------------------------
76 
77  virtual void Advance(WorkingMemory* workingMemory);
78 
82  void PerformQuery(WorkingMemory* workingMemory = KY_NULL);
83 
84  // ---------------------------------- Accessors ----------------------------------
85 
86  RayCanGoQueryResult GetResult() const;
87  const Vec3f& GetStartPos() const;
88  const Vec3f& GetDestPos() const;
89  const NavTrianglePtr& GetStartTrianglePtr() const;
90  const NavTrianglePtr& GetDestTrianglePtr() const;
91  ComputeCostMode GetComputeCostMode() const;
92  KyFloat32 GetComputedCost() const;
93  DynamicOutputMode GetDynamicOutputMode() const;
94  QueryDynamicOutput* GetQueryDynamicOutput() const;
95  RayCanGoMarginMode GetMarginMode() const;
96 
97  const PositionSpatializationRange& GetPositionSpatializationRange() const;
98 
99 public : // internal
100  void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
101  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
102  void SetDestIntegerPos(const WorldIntegerPos& destIntegerPos);
103  const WorldIntegerPos& GetStartIntegerPos() const;
104  const WorldIntegerPos& GetDestIntegerPos() const;
105 };
106 
107 }
108 
110 
111 
112 #endif //Navigation_RayCanGoQuery_H
113 
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
#define KY_NULL
Null value.
Definition: types.h:247
void SetDynamicOutputMode(DynamicOutputMode savingMode)
Write accessor for m_dynamicOutputMode.
Definition: raycangoquery.inl:38
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: raycangoquery.inl:84
void SetMarginMode(RayCanGoMarginMode marginMode)
Write accessor for m_marginMode.
Definition: raycangoquery.inl:36
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
The RayCanGoQuery class tests whether or not a ray (with a width of 0) can pass along a straight line...
Definition: raycangoquery.h:24
void PerformQuery(WorkingMemory *workingMemory=0)
Performs the query.
Definition: raycangoquery.inl:91
ComputeCostMode
Enumerates the possible ways a RayCanGoQuery can compute the cost of following the ray...
Definition: rayqueryutils.h:35
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
RayCanGoMarginMode
Defines the different mode for the NavMesh border margin to be used in RayCanGo queries.
Definition: database.h:41
Definition: gamekitcrowddispersion.h:20
void SetComputeCostMode(ComputeCostMode computeCostMode)
Write accessor for m_computeCostMode.
Definition: raycangoquery.inl:40
void SetPositionSpatializationRange(const PositionSpatializationRange &positionSpatializationRange)
Write accessor for m_positionSpatializationRange.
Definition: raycangoquery.inl:47
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
Base class for RayCanGoQuery.
Definition: baseraycangoquery.h:44
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: raycangoquery.inl:18
void SetStartTrianglePtr(const NavTrianglePtr &startTrianglePtr)
Set The NavMesh triangle that corresponds to m_startPos3f.
Definition: raycangoquery.inl:30
void SetQueryDynamicOutput(QueryDynamicOutput *queryDynamicOutput)
Write accessor for m_queryDynamicOutput.
Definition: raycangoquery.inl:42
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
RayCanGoQueryResult
Enumerates the possible results of a RayCanGoQuery.
Definition: baseraycangoquery.h:27
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