gwnavruntime/queries/utils/basediskexpansionquery.h Source File

basediskexpansionquery.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 
14 
15 namespace Kaim
16 {
17 
20 {
23 
29 
32 };
33 
36 {
37 public:
38  static QueryType GetStaticType() { return TypeDiskExpansion; }
39  virtual QueryType GetType() const { return TypeDiskExpansion; }
40  virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
41  virtual void InitFromQueryBlob(World* world, void* blob);
42  virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() { return CreateStaticQueryBlobHandler(); }
43  static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
44 
45 
46  // ---------------------------------- Main API Functions ----------------------------------
47 
48  DiskExpansionQueryResult GetResult() const;
49  const Vec3f& GetCenterPos() const;
50  const NavTrianglePtr& GetCenterTrianglePtr() const;
51  KyFloat32 GetRadiusMax() const;
52  KyFloat32 GetResultRadius() const;
53  const Vec3f& GetCollisionPos() const;
54  const NavHalfEdgePtr& GetCollisionNavHalfEdgePtr() const;
55  KyFloat32 GetSafetyDist() const;
56  DynamicOutputMode GetDynamicOutputMode() const;
57  QueryDynamicOutput* GetQueryDynamicOutput() const;
58  const WorldIntegerPos& GetCenterIntegerPos() const;
59 
60  const PositionSpatializationRange& GetPositionSpatializationRange() const;
61 
62 protected:
63  BaseDiskExpansionQuery();
64  virtual ~BaseDiskExpansionQuery() {}
65 
66  void BindToDatabase(Database* database);
67  void Initialize(const Vec3f& center, KyFloat32 radiusMax);
68 
69  void SetCenterTrianglePtr(const NavTrianglePtr& centerTrianglePtr);
70  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
71  void SetSafetyDist(KyFloat32 safetyDist);
72  void SetDynamicOutputMode(DynamicOutputMode savingMode);
73  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
74  void SetCenterIntegerPos(const WorldIntegerPos& centerIntegerPos);
75  void SetResult(DiskExpansionQueryResult result);
76 
77  DiskExpansionQueryResult ConvertTraversalResultToDiskExpansionResult(TraversalResult traversalRC);
78 protected:
79  WorldIntegerPos m_centerIntegerPos;
80 
82 
86 
89 
95 
98 
102 
106 
111 
113 
115 
122  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
123 };
124 
125 }
126 
128 
129 
Indicates a collision was detected when expanding the disk before the maximum size of the disk was re...
Definition: basediskexpansionquery.h:31
Indicates the query has not yet been initialized.
Definition: basediskexpansionquery.h:21
KyFloat32 m_resultRadius
Updated during processing to indicate the final result of the disk at the end of the query: ...
Definition: basediskexpansionquery.h:110
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position used to determine m_centerTrianglePtr from the m_centerPos3f...
Definition: basediskexpansionquery.h:97
Indicates that an unknown error occurred during the query processing.
Definition: basediskexpansionquery.h:28
Vertical range (above, below) that represents the altitude tolerance for a position to be inside the ...
Definition: positionspatializationrange.h:17
NavHalfEdgePtr m_collisionHalfEdgePtr
Updated during processing to indicate the triangle edge that the disk collided with (if a collision i...
Definition: basediskexpansionquery.h:105
Indicates that the disk fits inside the navigable areas of the NavMesh even at maximum size...
Definition: basediskexpansionquery.h:30
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:245
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:52
DiskExpansionQueryResult
Enumerates the possible results of a DiskExpansionQuery.
Definition: basediskexpansionquery.h:19
DynamicOutputMode
Enumerates possible ways of storing collected data by a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:21
NavTrianglePtr m_centerTrianglePtr
The NavMesh triangle that corresponds to m_centerPos3f.
Definition: basediskexpansionquery.h:85
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
Indicates that the NavTag at the center point is forbidden.
Definition: basediskexpansionquery.h:25
Base class for DiskExpansionQuery.
Definition: basediskexpansionquery.h:35
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:88
Indicates the query has not yet been launched.
Definition: basediskexpansionquery.h:22
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: basediskexpansionquery.h:114
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
Indicates that the center point lies outside the navigable area of the NavMesh.
Definition: basediskexpansionquery.h:24
virtual QueryType GetType() const
Get query type.
Definition: basediskexpansionquery.h:39
Indicates that insufficient working memory caused the query to stop.
Definition: basediskexpansionquery.h:27
Vec3f m_collisionPos3f
Updated during processing to indicate the position of the collision on the NavMesh border (if a colli...
Definition: basediskexpansionquery.h:101
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 the query has not yet been launched.
Definition: iquery.h:296
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: basediskexpansionquery.h:122
DiskExpansionQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: basediskexpansionquery.h:112
Vec3f m_centerPos3f
The position of the center of the disk.
Definition: basediskexpansionquery.h:81
Indicates that the center point lies within the NavMesh, but the disk cannot be expanded.
Definition: basediskexpansionquery.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
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16
KyFloat32 m_safetyDist
When a collision is detected, the radius is decreased by this distance, to ensure the final disk will...
Definition: basediskexpansionquery.h:94