gwnavruntime/queries/utils/baseraycangoonsegmentquery.h Source File

baseraycangoonsegmentquery.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_BaseRayCanGoOnSegmentQuery_H
10 #define Navigation_BaseRayCanGoOnSegmentQuery_H
11 
12 
19 
20 
21 
22 namespace Kaim
23 {
24 
25 class NavHalfEdgeRawPtr;
26 class RawNavTagSubSegment;
27 template <class T> class WorkingMemArray;
28 
31 {
34 
41 
43 };
44 
47 {
48 public:
49  static QueryType GetStaticType() { return TypeRayCanGoOnSegment; }
50  virtual QueryType GetType() const { return TypeRayCanGoOnSegment; }
51 
52 
53  // ---------------------------------- Main API Functions ----------------------------------
54 
55  RayCanGoOnSegmentQueryResult GetResult() const;
56  const Vec3f& GetStartPos() const;
57  const Vec3f& GetSegmentStartPos() const;
58  const Vec3f& GetSegmentEndPos() const;
59  const NavTrianglePtr& GetStartTrianglePtr() const;
60  const NavTrianglePtr& GetArrivalTrianglePtr() const;
61  ComputeCostMode GetComputeCostMode() const;
62  KyFloat32 GetComputedCost() const;
63  DynamicOutputMode GetDynamicOutputMode() const;
64  QueryDynamicOutput* GetQueryDynamicOutput() const;
65  const PositionSpatializationRange& GetPositionSpatializationRange() const;
66  const WorldIntegerPos& GetStartIntegerPos() const;
67  const WorldIntegerPos& GetSegmentStartIntegerPos() const;
68  const WorldIntegerPos& GetSegmentEndIntegerPos() const;
69 
70 protected:
73 
74  void BindToDatabase(Database* database);
75  void Initialize(const Vec3f& startPos, const NavTrianglePtr& startTrianglePtr, const Vec3f& segmentStartPos, const Vec3f& segmentEndPos);
76 
77  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
78  void SetDynamicOutputMode(DynamicOutputMode dynamicOutputMode);
79  void SetComputeCostMode(ComputeCostMode computeCostMode);
80  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
81  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
82  void SetSegmentStartIntegerPos(const WorldIntegerPos& segmentStartIntegerPos);
83  void SetSegmentEndIntegerPos(const WorldIntegerPos& segmentEndIntegerPos);
84  void SetResult(RayCanGoOnSegmentQueryResult result);
85 
86  void RayCanGo_NoHit(const NavHalfEdgeRawPtr& lastHalfEdgeRawPtr, CompositeSubSegment& subSegment, ScopedDynamicOutput& scopedDynamicOutput);
87 
88 protected:
89  WorldIntegerPos m_startIntegerPos;
90  WorldIntegerPos m_segmentStartIntegerPos;
91  WorldIntegerPos m_segmentEndIntegerPos;
92 
96 
98 
100  PositionSpatializationRange m_positionSpatializationRange;
106 
108  KyFloat32 m_cost;
109 
111 
118  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
119 };
120 
121 }
122 
124 
125 
126 
127 #endif //Navigation_BaseRayCanGoOnSegmentQuery_H
128 
Indicates that the query was not performed, because the value of BaseRayCanGoOnSegmentQuery::m_maxDis...
Definition: baseraycangoonsegmentquery.h:40
NavTrianglePtr m_destTrianglePtr
Updated during processing to indicate the NavMesh triangle that corresponds to m_segmentEndPos3f.
Definition: baseraycangoonsegmentquery.h:110
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
RayCanGoOnSegmentQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: baseraycangoonsegmentquery.h:112
ComputeCostMode m_computeCostMode
Determines whether or not the query computes the approximate cost of following the line segment...
Definition: baseraycangoonsegmentquery.h:114
KyFloat32 m_cost
Updated during processing to store the cost of the line segment, if enabled by m_computeCostMode.
Definition: baseraycangoonsegmentquery.h:115
Indicates the query has not yet been initialized.
Definition: baseraycangoonsegmentquery.h:32
RayCanGoOnSegmentQueryResult
Enumerates the possible results of a RayCanGoOnSegmentQuery.
Definition: baseraycangoonsegmentquery.h:30
Vec3f m_segmentEndPos3f
The ending point of the line segment support of this CanGo.
Definition: baseraycangoonsegmentquery.h:101
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: baseraycangoonsegmentquery.h:107
Indicates the query has not yet been launched.
Definition: baseraycangoonsegmentquery.h:33
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: baseraycangoonsegmentquery.h:117
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycangoonsegmentquery.h:42
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: baseraycangoonsegmentquery.h:104
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: baseraycangoonsegmentquery.h:127
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: baseraycangoonsegmentquery.h:35
Vec3f m_startPos3f
The starting point of the propagation.
Definition: baseraycangoonsegmentquery.h:102
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
Vec3f m_segmentStartPos3f
The starting point of the line segment support of this CanGo.
Definition: baseraycangoonsegmentquery.h:100
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycangoonsegmentquery.h:37
Definition: gamekitcrowddispersion.h:20
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
Indicates that none of the above results occurred, which may indicate that the start and end points l...
Definition: baseraycangoonsegmentquery.h:38
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not consid...
Definition: baseraycangoonsegmentquery.h:36
Indicates that the query has not yet been launched.
Definition: iquery.h:347
Base class for RayCanGoOnSegmentQuery.
Definition: baseraycangoonsegmentquery.h:46
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
Indicates that insufficient memory was available to store crossed triangles or sub-sections, and the query failed as a result.
Definition: baseraycangoonsegmentquery.h:39
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