gwnavruntime/queries/segmentcangoquery.h Source File

segmentcangoquery.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_SegmentCanGoQuery_H
10 #define Navigation_SegmentCanGoQuery_H
11 
18 
19 
20 namespace Kaim
21 {
22 
23 
42 template <class TraverseLogic>
43 class SegmentCanGoQuery : public BaseSegmentCanGoQuery
44 {
45 public:
46  // ---------------------------------- Public Member Functions ----------------------------------
47 
49  virtual ~SegmentCanGoQuery() {}
50 
51  // ---------------------------------- Functions to set up the query ----------------------------------
52 
56  void BindToDatabase(Database* database);
57 
64  void Initialize(const Vec3f& startPos, const Vec3f& destPos, KyFloat32 radius);
65 
66  // ---------------------------------- write accessors for query inputs ----------------------------------
67 
71  void SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr);
72 
75  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
76 
77  // ---------------------------------- write accessors for query parameters ----------------------------------
78 
81  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
82 
85  void SetDynamicOutputMode(DynamicOutputMode savingMode);
86 
87  // ---------------------------------- Query framework functions ----------------------------------
88 
89  virtual void Advance(WorkingMemory* workingMemory);
90 
94  void PerformQuery(WorkingMemory* workingMemory = KY_NULL);
95 
96  // ---------------------------------- Accessors ----------------------------------
97 
98  SegmentCanGoQueryResult GetResult() const;
99  const Vec3f& GetStartPos() const;
100  const Vec3f& GetDestPos() const;
101  const NavTrianglePtr& GetStartTrianglePtr() const;
102  const NavTrianglePtr& GetDestTrianglePtr() const;
103  KyFloat32 GetRadius() const;
104  DynamicOutputMode GetDynamicOutputMode() const;
105  QueryDynamicOutput* GetQueryDynamicOutput() const;
106 
107  const PositionSpatializationRange& GetPositionSpatializationRange() const;
108 
109 public : // internal
110  void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
111  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
112  void SetDestIntegerPos(const WorldIntegerPos& destIntegerPos);
113  const WorldIntegerPos& GetStartIntegerPos() const;
114  const WorldIntegerPos& GetDestIntegerPos() const;
115 };
116 
117 }
118 
120 
121 #endif //Navigation_SegmentCanGoQuery_H
122 
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
void SetPositionSpatializationRange(const PositionSpatializationRange &positionSpatializationRange)
Write accessor for m_positionSpatializationRange.
Definition: segmentcangoquery.inl:33
void SetDynamicOutputMode(DynamicOutputMode savingMode)
Write accessor for m_dynamicOutputMode.
Definition: segmentcangoquery.inl:48
#define KY_NULL
Null value.
Definition: types.h:247
SegmentCanGoQueryResult
Enumerates the possible results of a SegmentCanGoQuery.
Definition: basesegmentcangoquery.h:22
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
void SetStartTrianglePtr(const NavTrianglePtr &startTrianglePtr)
Set The NavMesh triangle that corresponds to m_startPos3f.
Definition: segmentcangoquery.inl:28
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: segmentcangoquery.inl:17
void SetQueryDynamicOutput(QueryDynamicOutput *queryDynamicOutput)
Write accessor for m_queryDynamicOutput.
Definition: segmentcangoquery.inl:53
Definition: gamekitcrowddispersion.h:20
The SegmentCanGoQuery class tests whether a line segment-with a specified half-width (m_radius)-can m...
Definition: segmentcangoquery.h:44
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
void PerformQuery(WorkingMemory *workingMemory=0)
Performs the query.
Definition: segmentcangoquery.inl:92
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: segmentcangoquery.inl:85
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
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