gwnavruntime/queries/utils/baseraycangoquery.h Source File

baseraycangoquery.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_BaseRayCanGoQuery_H
10 #define Navigation_BaseRayCanGoQuery_H
11 
17 
18 
19 namespace Kaim
20 {
21 
22 class NavHalfEdgeRawPtr;
23 class RawNavTagSubSegment;
24 template <class T> class WorkingMemArray;
25 
28 {
31 
39 
41 };
42 
45 {
46 public:
47  static QueryType GetStaticType() { return TypeRayCanGo; }
48  virtual QueryType GetType() const { return TypeRayCanGo; }
49  virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
50  virtual void InitFromQueryBlob(World* world, void* blob);
51  virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() { return CreateStaticQueryBlobHandler(); }
52  static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
53 
54 
55  // ---------------------------------- Main API Functions ----------------------------------
56 
57  RayCanGoQueryResult GetResult() const;
58  const Vec3f& GetStartPos() const;
59  const Vec3f& GetDestPos() const;
60  const NavTrianglePtr& GetStartTrianglePtr() const;
61  const NavTrianglePtr& GetDestTrianglePtr() const;
62  ComputeCostMode GetComputeCostMode() const;
63  KyFloat32 GetComputedCost() const;
64  DynamicOutputMode GetDynamicOutputMode() const;
65  QueryDynamicOutput* GetQueryDynamicOutput() const;
66  const WorldIntegerPos& GetStartIntegerPos() const;
67  const WorldIntegerPos& GetDestIntegerPos() const;
68  RayCanGoMarginMode GetMarginMode() const;
69 
70  const PositionSpatializationRange& GetPositionSpatializationRange() const;
71 
72 
73 public : // internal
74  void BindToDatabase(Database* database);
75  void Initialize(const Vec3f& startPos, const Vec3f& destPos);
76 
77  void SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr);
78  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
79  void SetMarginMode(RayCanGoMarginMode marginMode);
80  void SetDynamicOutputMode(DynamicOutputMode dynamicOutputMode);
81  void SetComputeCostMode(ComputeCostMode computeCostMode);
82  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
83  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
84  void SetDestIntegerPos(const WorldIntegerPos& destIntegerPos);
85 
86 protected:
88  virtual ~BaseRayCanGoQuery() {}
89 
90  void SetResult(RayCanGoQueryResult result);
91  void RayCanGo_NoHit(const NavHalfEdgeRawPtr& lastHalfEdgeRawPtr, CompositeSubSegment& subSegment, ScopedDynamicOutput& scopedDynamicOutput);
92 
93 protected:
94  WorldIntegerPos m_startIntegerPos;
95  WorldIntegerPos m_destIntegerPos;
96 
99 
102 
104  PositionSpatializationRange m_positionSpatializationRange;
105 
109  KyFloat32 m_cost;
112 
121  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
122 };
124 }
125 
127 
128 
129 
130 #endif //Navigation_BaseRayCanGoQuery_H
131 
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
NavTrianglePtr m_destTrianglePtr
The NavMesh triangle that corresponds to m_destPos3f. It will be computed automatically during the qu...
Definition: baseraycangoquery.h:111
Indicates that a collision was detected along the straight line between the starting and ending point...
Definition: baseraycangoquery.h:34
Indicates that the query has not yet been launched.
Definition: baseraycangoquery.h:30
Indicates that an unknown error occurred during the query processing.
Definition: baseraycangoquery.h:38
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:289
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position to use when determining m_startTrianglePtr and m_destTriangleP...
Definition: baseraycangoquery.h:114
Indicates that none of the above results occurred, which may indicate that the start and end points l...
Definition: baseraycangoquery.h:36
Indicates that the ray can pass in a straight line from the starting point to the ending point withou...
Definition: baseraycangoquery.h:40
Indicates that a border was detected close (less than margin) to the straight line between the starti...
Definition: baseraycangoquery.h:35
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
NavTrianglePtr m_startTrianglePtr
The NavMesh triangle that corresponds to m_startPos3f. You can set it as an input or retrieve it as a...
Definition: baseraycangoquery.h:110
KyFloat32 m_cost
Updated during processing to store the cost of the line segment, if enabled by m_computeCostMode.
Definition: baseraycangoquery.h:119
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
Indicates that insufficient memory was available to store crossed triangles or sub-sections, and the query failed as a result.
Definition: baseraycangoquery.h:37
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
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: baseraycangoquery.h:133
RayCanGoQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: baseraycangoquery.h:116
Definition: gamekitcrowddispersion.h:20
Vec3f m_startPos3f
The starting point of the line segment to be tested.
Definition: baseraycangoquery.h:107
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: baseraycangoquery.h:32
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: baseraycangoquery.h:123
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
Vec3f m_destPos3f
The ending point of the line segment to be tested.
Definition: baseraycangoquery.h:108
Base class for RayCanGoQuery.
Definition: baseraycangoquery.h:44
Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not consid...
Definition: baseraycangoquery.h:33
RayCanGoMarginMode m_marginMode
The margin mode to be used in this query to eventually ensure the ray is not too close to any NavMesh...
Definition: baseraycangoquery.h:121
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
Indicates that the query has not yet been initialized.
Definition: baseraycangoquery.h:29
Indicates that the query has not yet been launched.
Definition: iquery.h:347
ComputeCostMode m_computeCostMode
Determines whether or not the query computes the approximate cost of following the line segment...
Definition: baseraycangoquery.h:118
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
Each instance of this class uniquely identifies a singleNavHalfEdge in a NavFloor.
Definition: navhalfedgerawptr.h:34
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