gwnavruntime/queries/utils/basediskexpansionquery.h Source File

basediskexpansionquery.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_BaseDiskExpansionQuery_H
9 #define Navigation_BaseDiskExpansionQuery_H
10 
16 
17 
18 namespace Kaim
19 {
20 
23 {
26 
32 
35 };
36 
39 {
40 public:
41  static QueryType GetStaticType() { return TypeDiskExpansion; }
42  virtual QueryType GetType() const { return TypeDiskExpansion; }
43  virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
44  virtual void InitFromQueryBlob(World* world, void* blob);
45  virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() { return CreateStaticQueryBlobHandler(); }
46  static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
47 
48 
49  // ---------------------------------- Main API Functions ----------------------------------
50 
51  DiskExpansionQueryResult GetResult() const;
52  const Vec3f& GetCenterPos() const;
53  const NavTrianglePtr& GetCenterTrianglePtr() const;
54  KyFloat32 GetRadiusMax() const;
55  KyFloat32 GetResultRadius() const;
56  const Vec3f& GetCollisionPos() const;
57  const NavHalfEdgePtr& GetCollisionNavHalfEdgePtr() const;
58  KyFloat32 GetSafetyDist() const;
59  DynamicOutputMode GetDynamicOutputMode() const;
60  QueryDynamicOutput* GetQueryDynamicOutput() const;
61  const WorldIntegerPos& GetCenterIntegerPos() const;
62 
63  const PositionSpatializationRange& GetPositionSpatializationRange() const;
64 
65 protected:
67  virtual ~BaseDiskExpansionQuery() {}
68 
69  void BindToDatabase(Database* database);
70  void Initialize(const Vec3f& center, KyFloat32 radiusMax);
71 
72  void SetCenterTrianglePtr(const NavTrianglePtr& centerTrianglePtr);
73  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
74  void SetSafetyDist(KyFloat32 safetyDist);
75  void SetDynamicOutputMode(DynamicOutputMode savingMode);
76  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
77  void SetCenterIntegerPos(const WorldIntegerPos& centerIntegerPos);
78  void SetResult(DiskExpansionQueryResult result);
79 
80  DiskExpansionQueryResult ConvertTraversalResultToDiskExpansionResult(TraversalResult traversalRC);
81 protected:
82  WorldIntegerPos m_centerIntegerPos;
83 
85 
89 
92 
98 
100  PositionSpatializationRange m_positionSpatializationRange;
101 
109 
114 
118 
125  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
126 };
127 
128 }
129 
131 
132 #endif //Navigation_DiskCollisionQuery_H
133 
Indicates a collision was detected when expanding the disk before the maximum size of the disk was re...
Definition: basediskexpansionquery.h:34
Indicates the query has not yet been initialized.
Definition: basediskexpansionquery.h:24
KyFloat32 m_resultRadius
Updated during processing to indicate the final result of the disk at the end of the query: ...
Definition: basediskexpansionquery.h:121
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position used to determine m_centerTrianglePtr from the m_centerPos3f...
Definition: basediskexpansionquery.h:108
Indicates that an unknown error occurred during the query processing.
Definition: basediskexpansionquery.h:31
NavHalfEdgePtr m_collisionHalfEdgePtr
Updated during processing to indicate the triangle edge that the disk collided with (if a collision i...
Definition: basediskexpansionquery.h:116
Indicates that the disk fits inside the navigable areas of the NavMesh even at maximum size...
Definition: basediskexpansionquery.h:33
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:289
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
DiskExpansionQueryResult
Enumerates the possible results of a DiskExpansionQuery.
Definition: basediskexpansionquery.h:22
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
NavTrianglePtr m_centerTrianglePtr
The NavMesh triangle that corresponds to m_centerPos3f.
Definition: basediskexpansionquery.h:96
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
Indicates that the NavTag at the center point is forbidden.
Definition: basediskexpansionquery.h:28
Base class for DiskExpansionQuery.
Definition: basediskexpansionquery.h:38
KyFloat32 m_radiusMax
The maximum radius for the disk. If the disk expands to this radius without a collision, the query stops.
Definition: basediskexpansionquery.h:99
Indicates the query has not yet been launched.
Definition: basediskexpansionquery.h:25
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: basediskexpansionquery.h:125
Definition: gamekitcrowddispersion.h:20
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
Indicates that the center point lies outside the navigable area of the NavMesh.
Definition: basediskexpansionquery.h:27
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
Indicates that insufficient working memory caused the query to stop.
Definition: basediskexpansionquery.h:30
Vec3f m_collisionPos3f
Updated during processing to indicate the position of the collision on the NavMesh border (if a colli...
Definition: basediskexpansionquery.h:112
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 the query has not yet been launched.
Definition: iquery.h:347
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: basediskexpansionquery.h:135
DiskExpansionQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: basediskexpansionquery.h:123
Vec3f m_centerPos3f
The position of the center of the disk.
Definition: basediskexpansionquery.h:91
Indicates that the center point lies within the NavMesh, but the disk cannot be expanded.
Definition: basediskexpansionquery.h:29
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
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
KyFloat32 m_safetyDist
When a collision is detected, the radius is decreased by this distance, to ensure the final disk will...
Definition: basediskexpansionquery.h:105