gwnavruntime/queries/monodirectionalraycangoquery.h Source File

monodirectionalraycangoquery.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_MonodirectionalRayCanGoQuery_H
10 #define Navigation_MonodirectionalRayCanGoQuery_H
11 
15 
16 namespace Kaim
17 {
18 
22 template<class TraverseLogic>
24 {
25 public:
26  // ---------------------------------- Public Member Functions ----------------------------------
27 
29  virtual ~MonodirectionalRayCanGoQuery() {}
30 
31  // ---------------------------------- Functions to set up the query ----------------------------------
32 
36  void BindToDatabase(Database* database);
37 
43  void Initialize(const Vec3f& startPos, const Vec3f& destPos);
44 
45  // ---------------------------------- write accessors for query inputs ----------------------------------
46 
50  void SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr);
51 
54  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
55 
56  // ---------------------------------- write accessors for query parameters ----------------------------------
57 
60  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
61 
64  void SetComputeCostMode(ComputeCostMode computeCostMode);
65 
68  void SetMarginMode(RayCanGoMarginMode marginMode);
69 
72  void SetDynamicOutputMode(DynamicOutputMode savingMode);
73 
74  // ---------------------------------- Query framework functions ----------------------------------
75 
76  virtual void Advance(WorkingMemory* workingMemory);
77 
81  void PerformQuery(WorkingMemory* workingMemory = KY_NULL);
82 
83  // ---------------------------------- Accessors ----------------------------------
84 
85  RayCanGoQueryResult GetResult() const;
86  const Vec3f& GetStartPos() const;
87  const Vec3f& GetDestPos() const;
88  const NavTrianglePtr& GetStartTrianglePtr() const;
89  const NavTrianglePtr& GetDestTrianglePtr() const;
90  ComputeCostMode GetComputeCostMode() const;
91  KyFloat32 GetComputedCost() const;
92  DynamicOutputMode GetDynamicOutputMode() const;
93  QueryDynamicOutput* GetQueryDynamicOutput() const;
94 
95  const PositionSpatializationRange& GetPositionSpatializationRange() const;
96 
97 public : // internal
98  void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
99  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
100  void SetDestIntegerPos(const WorldIntegerPos& destIntegerPos);
101  const WorldIntegerPos& GetStartIntegerPos() const;
102  const WorldIntegerPos& GetDestIntegerPos() const;
103 };
104 
105 }
106 
108 
109 
110 #endif //Navigation_MonodirectionalRayCanGoQuery_H
111 
void PerformQuery(WorkingMemory *workingMemory=0)
Performs the query.
Definition: monodirectionalraycangoquery.inl:138
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: monodirectionalraycangoquery.inl:17
void SetComputeCostMode(ComputeCostMode computeCostMode)
Write accessor for m_computeCostMode.
Definition: monodirectionalraycangoquery.inl:54
#define KY_NULL
Null value.
Definition: types.h:247
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
void SetMarginMode(RayCanGoMarginMode marginMode)
Write accessor for m_marginMode.
Definition: monodirectionalraycangoquery.inl:39
void SetPositionSpatializationRange(const PositionSpatializationRange &positionSpatializationRange)
Write accessor for m_positionSpatializationRange.
Definition: monodirectionalraycangoquery.inl:61
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
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: monodirectionalraycangoquery.inl:131
Definition: gamekitcrowddispersion.h:20
The MonodirectionalRayCanGoQuery is an internal version of the RayCanGoQuery that is able test navTag...
Definition: monodirectionalraycangoquery.h:23
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
void SetQueryDynamicOutput(QueryDynamicOutput *queryDynamicOutput)
Write accessor for m_queryDynamicOutput.
Definition: monodirectionalraycangoquery.inl:49
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
void SetStartTrianglePtr(const NavTrianglePtr &startTrianglePtr)
Set The NavMesh triangle that corresponds to m_startPos3f.
Definition: monodirectionalraycangoquery.inl:29
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
void SetDynamicOutputMode(DynamicOutputMode savingMode)
Write accessor for m_dynamicOutputMode.
Definition: monodirectionalraycangoquery.inl:45
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