gwnavruntime/queries/utils/basesegmentcangoquery.h Source File

basesegmentcangoquery.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 
8 // Primary contact: JUBA - secondary contact: NOBODY
9 #ifndef Navigation_BaseSegmentCanGoQuery_H
10 #define Navigation_BaseSegmentCanGoQuery_H
11 
17 
18 namespace Kaim
19 {
20 
23 {
26 
33 
35 };
36 
39 {
40 public:
41  static QueryType GetStaticType() { return TypeSegmentCanGo; }
42  virtual QueryType GetType() const { return TypeSegmentCanGo; }
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  SegmentCanGoQueryResult GetResult() const;
52  const Vec3f& GetStartPos() const;
53  const Vec3f& GetDestPos() const;
54  const NavTrianglePtr& GetStartTrianglePtr() const;
55  const NavTrianglePtr& GetDestTrianglePtr() const;
56  KyFloat32 GetRadius() const;
57  DynamicOutputMode GetDynamicOutputMode() const;
58  QueryDynamicOutput* GetQueryDynamicOutput() const;
59  const WorldIntegerPos& GetStartIntegerPos() const;
60  const WorldIntegerPos& GetDestIntegerPos() const;
61 
62  const PositionSpatializationRange& GetPositionSpatializationRange() const;
63 
64 protected:
67 
68  void BindToDatabase(Database* database);
69  void Initialize(const Vec3f& startPos, const Vec3f& destPos, KyFloat32 radius);
70 
71  void SetStartTrianglePtr(const NavTrianglePtr& startTrianglePtr);
72  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
73  void SetDynamicOutputMode(DynamicOutputMode savingMode);
74  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
75  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
76  void SetDestIntegerPos(const WorldIntegerPos& destIntegerPos);
77  void SetResult(SegmentCanGoQueryResult result);
78 
79  SegmentCanGoQueryResult ConvertRayCanGoResultToSegmentCanGoResult(RayCanGoQueryResult result);
80  SegmentCanGoQueryResult ConvertTraversalResultToSegmentCanGoResult(TraversalResult traversalRC);
81 
82 protected:
83  WorldIntegerPos m_startIntegerPos;
84  WorldIntegerPos m_destIntegerPos;
85 
91 
93  PositionSpatializationRange m_positionSpatializationRange;
94 
96 
98 
105  Ptr<QueryDynamicOutput> m_queryDynamicOutput;
106 };
107 
108 }
109 
111 
112 #endif //Navigation_BaseSegmentCanGoQuery_H
113 
Indicates that the query has not yet been initialized.
Definition: basesegmentcangoquery.h:24
Indicates that insufficient working memory caused the query to stop.
Definition: basesegmentcangoquery.h:31
Vec3f m_startPos3f
The starting point of the line segment to be tested.
Definition: basesegmentcangoquery.h:93
Base class for SegmentCanGoQuery.
Definition: basesegmentcangoquery.h:38
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
Indicates that the query has not yet been launched.
Definition: basesegmentcangoquery.h:25
KyFloat32 m_radius
The radius of the disk.
Definition: basesegmentcangoquery.h:97
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:289
Indicates that the segment can pass in a straight line from its starting point to the ending point wi...
Definition: basesegmentcangoquery.h:34
DynamicOutputMode m_dynamicOutputMode
Specifies the type of data stored in m_queryDynamicOutput.
Definition: basesegmentcangoquery.h:104
SegmentCanGoQueryResult m_result
Updated during processing to indicate the results of the query.
Definition: basesegmentcangoquery.h:102
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
SegmentCanGoQueryResult
Enumerates the possible results of a SegmentCanGoQuery.
Definition: basesegmentcangoquery.h:22
PositionSpatializationRange m_positionSpatializationRange
The altitude range around the position to use when determining m_startTrianglePtr and m_destTriangleP...
Definition: basesegmentcangoquery.h:100
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
Indicates that none of the above results occurred, which may indicate that the start and end points l...
Definition: basesegmentcangoquery.h:30
Indicates that an unknown error occurred during the query processing.
Definition: basesegmentcangoquery.h:32
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basesegmentcangoquery.h:27
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
Vec3f m_destPos3f
The ending point of the line segment to be tested.
Definition: basesegmentcangoquery.h:94
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:95
Indicates that a collision was detected between the starting and ending points.
Definition: basesegmentcangoquery.h:29
Definition: gamekitcrowddispersion.h:20
Ptr< QueryDynamicOutput > m_queryDynamicOutput
A ref-counted Ptr to a QueryDynamicOutput instance, used to store the data encountered during the que...
Definition: basesegmentcangoquery.h:114
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
NavTrianglePtr m_destTrianglePtr
The NavMesh triangle that corresponds to m_destPos3f. It will be computed automatically during the qu...
Definition: basesegmentcangoquery.h:96
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
Indicates that the NavTag at the starting point was forbidden.
Definition: basesegmentcangoquery.h:28
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
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23