gwnavruntime/queries/utils/basediskcangoquery.h Source File

basediskcangoquery.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 // Primary contact: JUBA - secondary contact: NOBODY
8 #ifndef Navigation_BaseDiskCanGoQuery_H
9 #define Navigation_BaseDiskCanGoQuery_H
10 
16 
17 
18 namespace Kaim
19 {
20 
21 class NavTriangleRawPtr;
22 
25 {
28 
35 
37 };
38 
42 {
46 
58 };
59 
60 
62 class BaseDiskCanGoQuery : public IAtomicQuery
63 {
64 public:
65  static QueryType GetStaticType() { return TypeDiskCanGo; }
66  virtual QueryType GetType() const { return TypeDiskCanGo; }
67  virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
68  virtual void InitFromQueryBlob(World* world, void* blob);
69  virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() { return CreateStaticQueryBlobHandler(); }
70  static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
71 
72 
73  // ---------------------------------- Main API functions ----------------------------------
74 
75  DiskCanGoQueryResult GetResult() const;
76  const Vec3f& GetStartPos() const;
77  const Vec3f& GetDestPos() const;
78  const NavTrianglePtr& GetStartTrianglePtr() const;
79  const NavTrianglePtr& GetDestTrianglePtr() const;
80  KyFloat32 GetRadius() const;
81  DiskCanGoQueryType GetQueryType() const;
82  DynamicOutputMode GetDynamicOutputMode() const;
83  QueryDynamicOutput* GetQueryDynamicOutput() const;
84  const WorldIntegerPos& GetStartIntegerPos() const;
85  const WorldIntegerPos& GetDestIntegerPos() const;
86 
87  const PositionSpatializationRange& GetPositionSpatializationRange() const;
88 
89 protected:
90  BaseDiskCanGoQuery();
91  virtual ~BaseDiskCanGoQuery() {}
92 
93  void BindToDatabase(Database* database);
94  void Initialize(const Vec3f& startPos, const Vec3f& destPos, KyFloat32 radius);
95 
96  void SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr);
97  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
98  void SetQueryType(DiskCanGoQueryType queryType);
99  void SetDynamicOutputMode(DynamicOutputMode savingMode);
100  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
101  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
102  void SetDestIntegerPos(const WorldIntegerPos& destIntegerPos);
103  void SetResult(DiskCanGoQueryResult result);
104 
105  DiskCanGoQueryResult ConvertRayCanGoResultToDiskCanGoResult(RayCanGoQueryResult result);
106  DiskCanGoQueryResult ConvertTraversalResultToDiskCanGoResult(TraversalResult traversalRC);
107 
108 protected:
109  WorldIntegerPos m_startIntegerPos;
110  WorldIntegerPos m_destIntegerPos;
111 
112  Vec3f m_startPos3f;
113  Vec3f m_destPos3f;
114 
117  NavTrianglePtr m_startTrianglePtr;
118 
124 
127  PositionSpatializationRange m_positionSpatializationRange;
128 
133 
135 
137 
144  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
145 };
146 
147 }
148 
150 
151 
152 
153 #endif //Navigation_BaseDiskCanGoQuery_H
154 
DiskCanGoQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: basediskcangoquery.h:143
Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not consid...
Definition: basediskcangoquery.h:30
Indicates the query generated no results, which may indicate that the start and end points are on dif...
Definition: basediskcangoquery.h:32
Indicates the query has not yet been launched.
Definition: basediskcangoquery.h:27
Base class for DiskCanGoQuery.
Definition: basediskcangoquery.h:64
NavTrianglePtr m_startTrianglePtr
The NavMesh triangle that corresponds to m_startPos3f.
Definition: basediskcangoquery.h:126
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:289
DiskCanGoQueryType
Enumerates the possible behaviors of a BaseDiskCanGoQuery when the the starting point lies inside the...
Definition: basediskcangoquery.h:41
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: basediskcangoquery.h:145
Indicates the query has not yet been initialized.
Definition: basediskcangoquery.h:26
NavTrianglePtr m_destTrianglePtr
The NavMesh triangle that corresponds to m_destPos3f.
Definition: basediskcangoquery.h:130
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basediskcangoquery.h:29
KyFloat32 m_radius
The radius of the disk.
Definition: basediskcangoquery.h:132
DiskCanGoQueryType m_queryType
An element from the DiskCanGoQueryType enumeration that indicates if a degraded query should be run w...
Definition: basediskcangoquery.h:141
DiskCanGoQueryResult
Enumerates the possible results of a DiskCanGoQuery.
Definition: basediskcangoquery.h:24
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
Vec3f m_destPos3f
The end point of the line segment to be tested.
Definition: basediskcangoquery.h:122
Indicates that the disk can pass in a straight line-from start to end point-without a collision...
Definition: basediskcangoquery.h:36
Indicates that the query will detect a collision when the the starting point lies inside the NavMesh ...
Definition: basediskcangoquery.h:45
Vec3f m_startPos3f
The start point of the line segment to be tested.
Definition: basediskcangoquery.h:121
Definition: gamekitcrowddispersion.h:20
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position used when determining m_startTrianglePtr and m_destTrianglePtr...
Definition: basediskcangoquery.h:136
Indicates that a collision was detected along the straight line between the starting and ending point...
Definition: basediskcangoquery.h:31
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
Indicates that an unknown error occurred during the query processing.
Definition: basediskcangoquery.h:34
Indicates that the query has not yet been launched.
Definition: iquery.h:347
If the center of the disk lies near a boundary of the NavMesh, the query will try to avoid a collisio...
Definition: basediskcangoquery.h:59
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
RayCanGoQueryResult
Enumerates the possible results of a RayCanGoQuery.
Definition: baseraycangoquery.h:27
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
Indicates that insufficient working memory caused the query to stop.
Definition: basediskcangoquery.h:33
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: basediskcangoquery.h:155