gwnavruntime/queries/utils/baseraycastonsegmentquery.h Source File

baseraycastonsegmentquery.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
9 
10 
17 
18 
19 namespace Kaim
20 {
21 
22 class NavHalfEdgeRawPtr;
23 class RawNavTagSubSegment;
24 template <class T> class WorkingMemArray;
25 
28 {
31 
39 
42 };
43 
46 {
47 public:
48  static QueryType GetStaticType() { return TypeRayCastOnSegment; }
49  virtual QueryType GetType() const { return TypeRayCastOnSegment; }
50 
51 
52  // ---------------------------------- Main API Functions ----------------------------------
53 
54  RayCastOnSegmentQueryResult GetResult() const;
55  const Vec3f& GetStartPos() const;
56  const Vec3f& GetSegmentStartPos() const;
57  const Vec3f& GetSegmentEndPos() const;
58  const Vec3f& GetArrivalPos() const;
59  const NavTrianglePtr& GetStartTrianglePtr() const;
60  const NavTrianglePtr& GetArrivalTrianglePtr() const;
61  KyFloat32 GetMaxDist() const;
62  DynamicOutputMode GetDynamicOutputMode() const;
63  QueryDynamicOutput* GetQueryDynamicOutput() const;
64  const WorldIntegerPos& GetStartIntegerPos() const;
65  const WorldIntegerPos& GetArrivalIntegerPos() const;
66  const WorldIntegerPos& GetSegmentStartIntegerPos() const;
67  const WorldIntegerPos& GetSegmentEndIntegerPos() const;
68 
69  const PositionSpatializationRange& GetPositionSpatializationRange() const;
70 
71 protected:
73  virtual ~BaseRayCastOnSegmentQuery() {}
74 
75  void BindToDatabase(Database* database);
76  void Initialize(const Vec3f& startPos, const NavTrianglePtr& startTrianglePtr, const Vec3f& segmentStartPos, const Vec3f& segmentEndPos, KyFloat32 maxDist);
77 
78  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
79  void SetDynamicOutputMode(DynamicOutputMode dynamicOutputMode);
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(RayCastOnSegmentQueryResult result);
85 
86  void RayCast_NoHit(const NavHalfEdgeRawPtr& lastHalfEdgeRawPtr, const WorldIntegerPos& destIntegerPos, const Vec3f& destPos3f,
87  CompositeSubSegment& subSegment, ScopedDynamicOutput& scopedDynamicOutput);
88 
89 protected:
90  WorldIntegerPos m_startIntegerPos;
91  WorldIntegerPos m_arrivalIntegerPos;
92  WorldIntegerPos m_segmentStartIntegerPos;
93  WorldIntegerPos m_segmentEndIntegerPos;
94 
100 
103 
109 
112 
116 
119 
121 
123 
130  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
131 };
132 
133 }
134 
136 
137 
138 
139 
Vec3f m_arrivalPos3f
Updated during processing to indicate the final position of the ray at the end of the cast...
Definition: baseraycastonsegmentquery.h:99
Indicates that the query was not performed, because the value of RayCastOnSegmentQuery::m_maxDist is ...
Definition: baseraycastonsegmentquery.h:37
NavTrianglePtr m_arrivalTrianglePtr
Updated during processing to indicate the NavMesh triangle that corresponds to m_arrivalPos3f.
Definition: baseraycastonsegmentquery.h:115
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:57
Indicates that an unknown error occurred during the query processing.
Definition: baseraycastonsegmentquery.h:38
Vertical range (above, below) that represents the altitude tolerance for a position to be inside the ...
Definition: positionspatializationrange.h:17
RayCastOnSegmentQueryResult
Enumerates the possible results of a RayCastOnSegmentQuery.
Definition: baseraycastonsegmentquery.h:27
Indicates that insufficient memory was available to store crossed triangles or sub-sections, and the query failed as a result.
Definition: baseraycastonsegmentquery.h:36
Indicates that the query has not yet been launched.
Definition: baseraycastonsegmentquery.h:30
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:245
KyFloat32 m_maxDist
Determines the maximum distance the disk will travel.
Definition: baseraycastonsegmentquery.h:108
NavHalfEdgePtr m_collisionHalfEdgePtr
If a collision was detected, this is updated to indicate the triangle edge that the ray collided with...
Definition: baseraycastonsegmentquery.h:118
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycastonsegmentquery.h:40
DynamicOutputMode
Enumerates possible ways of storing collected data by a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:21
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: baseraycastonsegmentquery.h:122
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: baseraycastonsegmentquery.h:130
Vec3f m_segmentEndPos3f
The ending point of the line segment support of this Cast.
Definition: baseraycastonsegmentquery.h:96
Vec3f m_startPos3f
The starting point of propagation on the NavMesh.
Definition: baseraycastonsegmentquery.h:97
Indicates that a collision point was found, but moving back from that point resulted in an arrival po...
Definition: baseraycastonsegmentquery.h:35
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
Indicates that the query has not yet been initialized.
Definition: baseraycastonsegmentquery.h:29
RayCastOnSegmentQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: baseraycastonsegmentquery.h:120
Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not consid...
Definition: baseraycastonsegmentquery.h:33
Vec3f m_collisionPos3f
Updated to indicate the position at which the ray collided with the NavMesh border, NavTag or Obstacle.
Definition: baseraycastonsegmentquery.h:98
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycastonsegmentquery.h:41
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position to use when determining m_startTrianglePtr from the m_startPos...
Definition: baseraycastonsegmentquery.h:111
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:102
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
Base class for RayCastOnSegmentQuery.
Definition: baseraycastonsegmentquery.h:45
virtual QueryType GetType() const
Get query type.
Definition: baseraycastonsegmentquery.h:49
Indicates that the starting point is very close to a NavMesh border, such that moving back the collis...
Definition: baseraycastonsegmentquery.h:34
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:19
Vec3f m_segmentStartPos3f
The starting point of the line segment support of this Cast.
Definition: baseraycastonsegmentquery.h:95
Each instance of this class uniquely identifies a single NavHalfEdge in a NavFloor.
Definition: navhalfedgeptr.h:16
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:17
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: baseraycastonsegmentquery.h:32
Indicates that the query has not yet been launched.
Definition: iquery.h:296
void Initialize()
Should be called by the derived class prior to perform the query or to push it in a QueryQueue...
Definition: iquery.h:220
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16