gwnavruntime/queries/utils/baseraycangoonsegmentquery.h Source File

baseraycangoonsegmentquery.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 #pragma once
8 
15 
16 namespace Kaim
17 {
18 
19 class NavHalfEdgeRawPtr;
20 class RawNavTagSubSegment;
21 
24 {
27 
34 
36 };
37 
40 {
41 public:
42  static QueryType GetStaticType() { return TypeRayCanGoOnSegment; }
43  virtual QueryType GetType() const { return TypeRayCanGoOnSegment; }
44 
45  void BindToDatabase(Database* database);
46  void Initialize(const Vec3f& startPos, const NavTrianglePtr& startTrianglePtr, const Vec3f& segmentStartPos, const Vec3f& segmentEndPos);
47 
48  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos) { m_startIntegerPos = startIntegerPos; }
49  void SetSegmentStartIntegerPos(const WorldIntegerPos& segmentStartIntegerPos) { m_segmentStartIntegerPos = segmentStartIntegerPos; }
50  void SetSegmentEndIntegerPos(const WorldIntegerPos& segmentEndIntegerPos) { m_segmentEndIntegerPos = segmentEndIntegerPos; }
51  void SetDynamicOutputMode(DynamicOutputMode dynamicOutputMode) { m_dynamicOutputMode = dynamicOutputMode; }
52  void SetComputeCostMode(ComputeCostMode computeCostMode) { m_computeCostMode = computeCostMode; }
53  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput) { m_queryDynamicOutput = queryDynamicOutput; }
54  void SetResult(RayCanGoOnSegmentQueryResult result) { m_result = result; }
55  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange) { m_positionSpatializationRange = positionSpatializationRange; }
56 
57  RayCanGoOnSegmentQueryResult GetResult () const { return m_result; }
58  ComputeCostMode GetComputeCostMode() const { return m_computeCostMode; }
59  KyFloat32 GetComputedCost() const { return m_cost; }
60  DynamicOutputMode GetDynamicOutputMode() const { return m_dynamicOutputMode; }
61  QueryDynamicOutput* GetQueryDynamicOutput() const { return m_queryDynamicOutput; }
62  const Vec3f& GetStartPos() const { return m_startPos3f; }
63  const Vec3f& GetSegmentStartPos() const { return m_segmentStartPos3f; }
64  const Vec3f& GetSegmentEndPos() const { return m_segmentEndPos3f; }
65  const NavTrianglePtr& GetStartTrianglePtr() const { return m_startTrianglePtr; }
66  const NavTrianglePtr& GetArrivalTrianglePtr() const { return m_destTrianglePtr; }
67  const WorldIntegerPos& GetStartIntegerPos() const { return m_startIntegerPos; }
68  const WorldIntegerPos& GetSegmentStartIntegerPos() const { return m_segmentStartIntegerPos; }
69  const WorldIntegerPos& GetSegmentEndIntegerPos() const { return m_segmentEndIntegerPos; }
70 
71  const PositionSpatializationRange& GetPositionSpatializationRange() const { return m_positionSpatializationRange; }
72 
73 protected:
74  BaseRayCanGoOnSegmentQuery();
75  ~BaseRayCanGoOnSegmentQuery() {}
76  void RayCanGo_NoHit(const NavHalfEdgeRawPtr& lastHalfEdgeRawPtr, CompositeSubSegment& subSegment, ScopedDynamicOutput& scopedDynamicOutput);
77 
78 protected:
79  WorldIntegerPos m_startIntegerPos;
80  WorldIntegerPos m_segmentStartIntegerPos;
81  WorldIntegerPos m_segmentEndIntegerPos;
82 
86 
88 
91 
94 
96 
100 
102 
104 
111  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
112 };
113 
114 }
115 
116 
117 
Indicates that the query was not performed, because the value of BaseRayCanGoOnSegmentQuery::m_maxDis...
Definition: baseraycangoonsegmentquery.h:33
NavTrianglePtr m_destTrianglePtr
Updated during processing to indicate the NavMesh triangle that corresponds to m_segmentEndPos3f.
Definition: baseraycangoonsegmentquery.h:93
Vertical range (above, below) that represents the altitude tolerance for a position to be inside the ...
Definition: positionspatializationrange.h:17
RayCanGoOnSegmentQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: baseraycangoonsegmentquery.h:95
ComputeCostMode m_computeCostMode
Determines whether or not the query computes the approximate cost of following the line segment...
Definition: baseraycangoonsegmentquery.h:99
KyFloat32 m_cost
Updated during processing to store the cost of the line segment, if enabled by m_computeCostMode.
Definition: baseraycangoonsegmentquery.h:101
Indicates the query has not yet been initialized.
Definition: baseraycangoonsegmentquery.h:25
RayCanGoOnSegmentQueryResult
Enumerates the possible results of a RayCanGoOnSegmentQuery.
Definition: baseraycangoonsegmentquery.h:23
Vec3f m_segmentEndPos3f
The ending point of the line segment support of this CanGo.
Definition: baseraycangoonsegmentquery.h:84
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:245
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position to use when determining m_startTrianglePtr and m_destTriangleP...
Definition: baseraycangoonsegmentquery.h:90
Indicates the query has not yet been launched.
Definition: baseraycangoonsegmentquery.h:26
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: baseraycangoonsegmentquery.h:103
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycangoonsegmentquery.h:35
DynamicOutputMode
Enumerates possible ways of storing collected data by a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:21
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:87
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: baseraycangoonsegmentquery.h:111
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: baseraycangoonsegmentquery.h:28
Vec3f m_startPos3f
The starting point of the propagation.
Definition: baseraycangoonsegmentquery.h:85
ComputeCostMode
Enumerates the possible ways a RayCanGoQuery can compute the cost of following the ray...
Definition: rayqueryutils.h:33
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:57
Vec3f m_segmentStartPos3f
The starting point of the line segment support of this CanGo.
Definition: baseraycangoonsegmentquery.h:83
Indicates that the ray was able to travel its maximum distance without collision. ...
Definition: baseraycangoonsegmentquery.h:30
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:19
Indicates that none of the above results occurred, which may indicate that the start and end points l...
Definition: baseraycangoonsegmentquery.h:31
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:17
virtual QueryType GetType() const
Get query type.
Definition: baseraycangoonsegmentquery.h:43
Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not consid...
Definition: baseraycangoonsegmentquery.h:29
Indicates that the query has not yet been launched.
Definition: iquery.h:296
Base class for RayCanGoOnSegmentQuery.
Definition: baseraycangoonsegmentquery.h:39
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
Indicates that insufficient memory was available to store crossed triangles or sub-sections, and the query failed as a result.
Definition: baseraycangoonsegmentquery.h:32
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16