gwnavruntime/queries/utils/basesegmentcangoquery.h Source File

basesegmentcangoquery.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 
15 
16 namespace Kaim
17 {
18 
21 {
24 
31 
33 };
34 
37 {
38 public:
39  static QueryType GetStaticType() { return TypeSegmentCanGo; }
40  virtual QueryType GetType() const { return TypeSegmentCanGo; }
41  virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
42  virtual void InitFromQueryBlob(World* world, void* blob);
43  virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() { return CreateStaticQueryBlobHandler(); }
44  static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
45 
46 
47  // ---------------------------------- Main API Functions ----------------------------------
48 
49  SegmentCanGoQueryResult GetResult() const;
50  const Vec3f& GetStartPos() const;
51  const Vec3f& GetDestPos() const;
52  const NavTrianglePtr& GetStartTrianglePtr() const;
53  const NavTrianglePtr& GetDestTrianglePtr() const;
54  KyFloat32 GetRadius() const;
55  DynamicOutputMode GetDynamicOutputMode() const;
56  QueryDynamicOutput* GetQueryDynamicOutput() const;
57  const WorldIntegerPos& GetStartIntegerPos() const;
58  const WorldIntegerPos& GetDestIntegerPos() const;
59 
60  const PositionSpatializationRange& GetPositionSpatializationRange() const;
61 
62 protected:
63  BaseSegmentCanGoQuery();
64  ~BaseSegmentCanGoQuery() {}
65 
66  void BindToDatabase(Database* database);
67  void Initialize(const Vec3f& startPos, const Vec3f& destPos, KyFloat32 radius);
68 
69  void SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr);
70  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
71  void SetDynamicOutputMode(DynamicOutputMode savingMode);
72  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
73  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
74  void SetDestIntegerPos(const WorldIntegerPos& destIntegerPos);
75  void SetResult(SegmentCanGoQueryResult result);
76 
77  SegmentCanGoQueryResult ConvertRayCanGoResultToSegmentCanGoResult(RayCanGoQueryResult result);
78  SegmentCanGoQueryResult ConvertTraversalResultToSegmentCanGoResult(TraversalResult traversalRC);
79 
80 protected:
81  WorldIntegerPos m_startIntegerPos;
82  WorldIntegerPos m_destIntegerPos;
83 
89 
92 
94 
96 
103  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
104 };
105 
106 }
107 
109 
110 
Indicates that the query has not yet been initialized.
Definition: basesegmentcangoquery.h:22
Indicates that insufficient working memory caused the query to stop.
Definition: basesegmentcangoquery.h:29
Vec3f m_startPos3f
The starting point of the line segment to be tested.
Definition: basesegmentcangoquery.h:84
Base class for SegmentCanGoQuery.
Definition: basesegmentcangoquery.h:36
Indicates that the query has not yet been launched.
Definition: basesegmentcangoquery.h:23
Vertical range (above, below) that represents the altitude tolerance for a position to be inside the ...
Definition: positionspatializationrange.h:17
KyFloat32 m_radius
The radius of the disk.
Definition: basesegmentcangoquery.h:88
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:245
Indicates that the segment can pass in a straight line from its starting point to the ending point wi...
Definition: basesegmentcangoquery.h:32
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: basesegmentcangoquery.h:95
SegmentCanGoQueryResult m_result
Updated during processing to indicate the results of the query.
Definition: basesegmentcangoquery.h:93
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:52
SegmentCanGoQueryResult
Enumerates the possible results of a SegmentCanGoQuery.
Definition: basesegmentcangoquery.h:20
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position to use when determining m_startTrianglePtr and m_destTriangleP...
Definition: basesegmentcangoquery.h:91
DynamicOutputMode
Enumerates possible ways of storing collected data by a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:21
Indicates that none of the above results occurred, which may indicate that the start and end points l...
Definition: basesegmentcangoquery.h:28
Indicates that an unknown error occurred during the query processing.
Definition: basesegmentcangoquery.h:30
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basesegmentcangoquery.h:25
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
Vec3f m_destPos3f
The ending point of the line segment to be tested.
Definition: basesegmentcangoquery.h:85
NavTrianglePtr m_startTrianglePtr
The NavMesh triangle that corresponds to m_startPos3f. You can set it as an input or retrieve it as a...
Definition: basesegmentcangoquery.h:86
Indicates that a collision was detected between the starting and ending points.
Definition: basesegmentcangoquery.h:27
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: basesegmentcangoquery.h:103
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
virtual QueryType GetType() const
Get query type.
Definition: basesegmentcangoquery.h:40
NavTrianglePtr m_destTrianglePtr
The NavMesh triangle that corresponds to m_destPos3f. It will be computed automatically during the qu...
Definition: basesegmentcangoquery.h:87
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:17
Indicates that the query has not yet been launched.
Definition: iquery.h:296
Indicates that the NavTag at the starting point was forbidden.
Definition: basesegmentcangoquery.h:26
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
RayCanGoQueryResult
Enumerates the possible results of a RayCanGoQuery.
Definition: baseraycangoquery.h:24
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16