gwnavruntime/queries/utils/baseraycastonsegmentquery.h Source File

baseraycastonsegmentquery.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_BaseRayCastOnSegmentQuery_H
10 #define Navigation_BaseRayCastOnSegmentQuery_H
11 
12 
19 
20 
21 namespace Kaim
22 {
23 
24 class NavHalfEdgeRawPtr;
25 class RawNavTagSubSegment;
26 template <class T> class WorkingMemArray;
27 
30 {
33 
41 
44 };
45 
48 {
49 public:
50  static QueryType GetStaticType() { return TypeRayCastOnSegment; }
51  virtual QueryType GetType() const { return TypeRayCastOnSegment; }
52 
53 
54  // ---------------------------------- Main API Functions ----------------------------------
55 
56  RayCastOnSegmentQueryResult GetResult() const;
57  const Vec3f& GetStartPos() const;
58  const Vec3f& GetSegmentStartPos() const;
59  const Vec3f& GetSegmentEndPos() const;
60  const Vec3f& GetArrivalPos() const;
61  const NavTrianglePtr& GetStartTrianglePtr() const;
62  const NavTrianglePtr& GetArrivalTrianglePtr() const;
63  KyFloat32 GetMaxDist() const;
64  DynamicOutputMode GetDynamicOutputMode() const;
65  QueryDynamicOutput* GetQueryDynamicOutput() const;
66  const WorldIntegerPos& GetStartIntegerPos() const;
67  const WorldIntegerPos& GetArrivalIntegerPos() const;
68  const WorldIntegerPos& GetSegmentStartIntegerPos() const;
69  const WorldIntegerPos& GetSegmentEndIntegerPos() const;
70 
71  const PositionSpatializationRange& GetPositionSpatializationRange() const;
72 
73 protected:
75  virtual ~BaseRayCastOnSegmentQuery() {}
76 
77  void BindToDatabase(Database* database);
78  void Initialize(const Vec3f& startPos, const NavTrianglePtr& startTrianglePtr, const Vec3f& segmentStartPos, const Vec3f& segmentEndPos, KyFloat32 maxDist);
79 
80  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
81  void SetDynamicOutputMode(DynamicOutputMode dynamicOutputMode);
82  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
83  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
84  void SetSegmentStartIntegerPos(const WorldIntegerPos& segmentStartIntegerPos);
85  void SetSegmentEndIntegerPos(const WorldIntegerPos& segmentEndIntegerPos);
86  void SetResult(RayCastOnSegmentQueryResult result);
87 
88  void RayCast_NoHit(const NavHalfEdgeRawPtr& lastHalfEdgeRawPtr, const WorldIntegerPos& destIntegerPos, const Vec3f& destPos3f,
89  CompositeSubSegment& subSegment, ScopedDynamicOutput& scopedDynamicOutput);
90 
91 protected:
92  WorldIntegerPos m_startIntegerPos;
93  WorldIntegerPos m_arrivalIntegerPos;
94  WorldIntegerPos m_segmentStartIntegerPos;
95  WorldIntegerPos m_segmentEndIntegerPos;
96 
102 
113  PositionSpatializationRange m_positionSpatializationRange;
114 
123 
132  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
133 };
134 
135 }
136 
138 
139 
140 
141 #endif //Navigation_BaseRayCastOnSegmentQuery_H
Vec3f m_arrivalPos3f
Updated during processing to indicate the final position of the ray at the end of the cast...
Definition: baseraycastonsegmentquery.h:108
Indicates that the query was not performed, because the value of RayCastOnSegmentQuery::m_maxDist is ...
Definition: baseraycastonsegmentquery.h:39
NavTrianglePtr m_arrivalTrianglePtr
Updated during processing to indicate the NavMesh triangle that corresponds to m_arrivalPos3f.
Definition: baseraycastonsegmentquery.h:125
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
Indicates that an unknown error occurred during the query processing.
Definition: baseraycastonsegmentquery.h:40
RayCastOnSegmentQueryResult
Enumerates the possible results of a RayCastOnSegmentQuery.
Definition: baseraycastonsegmentquery.h:29
Indicates that insufficient memory was available to store crossed triangles or sub-sections, and the query failed as a result.
Definition: baseraycastonsegmentquery.h:38
Indicates that the query has not yet been launched.
Definition: baseraycastonsegmentquery.h:32
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:289
KyFloat32 m_maxDist
Determines the maximum distance the disk will travel.
Definition: baseraycastonsegmentquery.h:118
NavHalfEdgePtr m_collisionHalfEdgePtr
If a collision was detected, this is updated to indicate the triangle edge that the ray collided with...
Definition: baseraycastonsegmentquery.h:128
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycastonsegmentquery.h:42
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: baseraycastonsegmentquery.h:132
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: baseraycastonsegmentquery.h:142
Vec3f m_segmentEndPos3f
The ending point of the line segment support of this Cast.
Definition: baseraycastonsegmentquery.h:105
Vec3f m_startPos3f
The starting point of propagation on the NavMesh.
Definition: baseraycastonsegmentquery.h:106
Indicates that a collision point was found, but moving back from that point resulted in an arrival po...
Definition: baseraycastonsegmentquery.h:37
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
Indicates that the query has not yet been initialized.
Definition: baseraycastonsegmentquery.h:31
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
RayCastOnSegmentQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: baseraycastonsegmentquery.h:130
Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not consid...
Definition: baseraycastonsegmentquery.h:35
Vec3f m_collisionPos3f
Updated to indicate the position at which the ray collided with the NavMesh border, NavTag or Obstacle.
Definition: baseraycastonsegmentquery.h:107
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycastonsegmentquery.h:43
Definition: gamekitcrowddispersion.h:20
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position to use when determining m_startTrianglePtr from the m_startPos...
Definition: baseraycastonsegmentquery.h:121
NavTrianglePtr m_startTrianglePtr
The NavMesh triangle that corresponds to m_startPos3f. You can set it as an input or retrieve it as a...
Definition: baseraycastonsegmentquery.h:111
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
Base class for RayCastOnSegmentQuery.
Definition: baseraycastonsegmentquery.h:47
Indicates that the starting point is very close to a NavMesh border, such that moving back the collis...
Definition: baseraycastonsegmentquery.h:36
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
Vec3f m_segmentStartPos3f
The starting point of the line segment support of this Cast.
Definition: baseraycastonsegmentquery.h:104
Each instance of this class uniquely identifies a single NavHalfEdge in a NavFloor.
Definition: navhalfedgeptr.h:19
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: baseraycastonsegmentquery.h:34
Indicates that the query has not yet been launched.
Definition: iquery.h:347
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
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