gwnavruntime/queries/utils/basepathfrompolylinequery.h Source File

basepathfrompolylinequery.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_BasePathFromPolylineQuery_H
10 #define Navigation_BasePathFromPolylineQuery_H
11 
17 
18 namespace Kaim
19 {
20 
21 class Path;
22 
23 
26 {
29 
35 
47 
50 };
51 
52 
55 {
56 public:
57  static QueryType GetStaticType() { return TypePathFromPolyline; }
58  virtual QueryType GetType() const { return TypePathFromPolyline; }
59 
60  // ---------------------------------- Main API functions ----------------------------------
61 
62  virtual void GetPathFinderTextResult(String&) const;
63  virtual PathFinderResult GetPathFinderResult() const;
64  virtual const Vec3f* GetDestination() const;
65 
66  PathFromPolylineQueryResult GetResult() const;
67  const Vec3f& GetStartPos() const;
68  const KyArrayPOD<Vec3f>& GetPolyline() const;
69  PathFinderQueryComputeChannelMode GetComputeChannelMode() const;
70  const ChannelComputerConfig& GetChannelComputerConfig() const;
71  Path* GetPath() const;
72  ChannelArray* GetChannelArray() const;
73  KyUInt32 GetNumberOfProcessedNodePerFrame() const;
74 
75  const PositionSpatializationRange& GetPositionSpatializationRange() const;
76 
77 public: // Internal
78  void BindToDatabase(Database* database);
79  void Initialize(const Vec3f* vertexBuffer, KyUInt32 vertexCount);
80 
81  void SetComputeChannelMode(PathFinderQueryComputeChannelMode computeChannelMode);
82  void SetChannelComputerConfig(const ChannelComputerConfig& channelComputerConfig);
83  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
84 
85  void SetPathClamperFlagMask(PathClamperFlagMask pathClamperFlagMask); // Call this method after BindToDatabase()
86 
87 protected :
89  virtual ~BasePathFromPolylineQuery() {}
90  void SetResult(PathFromPolylineQueryResult result);
91 
92 protected :
93  KyArrayPOD<Vec3f> m_polylinePositions;
94 
96  PositionSpatializationRange m_positionSpatializationRange;
97 
99 
100  PathClamperFlagMask m_pathClamperFlagMask;
101 
102 public : //internal
105 
108 };
109 
110 
111 KY_INLINE void BasePathFromPolylineQuery::SetResult(PathFromPolylineQueryResult result) { m_result = result; }
112 KY_INLINE void BasePathFromPolylineQuery::SetComputeChannelMode(PathFinderQueryComputeChannelMode mode) { m_computeChannelMode = mode; }
113 KY_INLINE void BasePathFromPolylineQuery::SetChannelComputerConfig(const ChannelComputerConfig& config) { m_channelComputerConfig = config; }
114 
115 KY_INLINE PathFromPolylineQueryResult BasePathFromPolylineQuery::GetResult() const { return m_result; }
116 KY_INLINE Path* BasePathFromPolylineQuery::GetPath() const { return m_path; }
117 KY_INLINE PathFinderQueryComputeChannelMode BasePathFromPolylineQuery::GetComputeChannelMode() const { return m_computeChannelMode; }
118 KY_INLINE const ChannelComputerConfig& BasePathFromPolylineQuery::GetChannelComputerConfig() const { return m_channelComputerConfig; }
119 KY_INLINE const Vec3f& BasePathFromPolylineQuery::GetStartPos() const { return IPathFinderQuery::GetStartPos(); }
120 KY_INLINE const KyArrayPOD<Vec3f>& BasePathFromPolylineQuery::GetPolyline() const { return m_polylinePositions; }
121 KY_INLINE const Vec3f* BasePathFromPolylineQuery::GetDestination() const
122 {
123  if (m_polylinePositions.GetCount() == 0)
124  return KY_NULL;
125 
126  return &m_polylinePositions.Back();
127 }
128 
129 KY_INLINE const PositionSpatializationRange& BasePathFromPolylineQuery::GetPositionSpatializationRange() const { return m_positionSpatializationRange; }
130 KY_INLINE void BasePathFromPolylineQuery::SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange)
131 {
132  m_positionSpatializationRange = positionSpatializationRange;
133 }
134 
135 KY_INLINE void BasePathFromPolylineQuery::SetPathClamperFlagMask(PathClamperFlagMask pathClamperFlagMask) { m_pathClamperFlagMask = pathClamperFlagMask; }
136 
137 }
138 
139 #endif //Navigation_AstarQuery_H
140 
General purpose array for movable objects that DOES NOT require construction/destruction.
Definition: kyarray.h:156
ChannelComputerConfig m_channelComputerConfig
The parameter set specific to Channels computation.
Definition: ipathfinderquery.h:103
Base class for all pathfinder queries.
Definition: ipathfinderquery.h:38
Indicates that query starting location and ending location are equals. computing a Path would have le...
Definition: basepathfrompolylinequery.h:48
Indicates that the query has stopped and must be relaunched because of a change in the NavData...
Definition: basepathfrompolylinequery.h:40
Indicates that the clamper is beeing initialized.
Definition: basepathfrompolylinequery.h:30
PathFinderQueryComputeChannelMode
This enum tells if the PathFinderQuery should compute Channels around path sections laying on the Nav...
Definition: ipathfinderquery.h:28
Base class for AstarQuery.
Definition: basepathfrompolylinequery.h:54
PathFromPolylineQueryResult
Enumerates the possible results of an PathFromPolylineQuery.
Definition: basepathfrompolylinequery.h:25
Indicates that a computation error caused the query to stop.
Definition: basepathfrompolylinequery.h:42
Class that aggregates parameters that allow to configure the channel computation of a Bot...
Definition: channelcomputerconfig.h:76
#define KY_NULL
Null value.
Definition: types.h:247
PathFromPolylineQueryResult m_result
Updated during processing to indicate the result of the PathFinderQueryResult query.
Definition: basepathfrompolylinequery.h:106
Indicates that the input polyline in empty.
Definition: basepathfrompolylinequery.h:46
This class aggregates Channels along a Path.
Definition: channelarray.h:31
Ptr< Path > m_path
The Path found by the query.
Definition: ipathfinderquery.h:98
Unused. Kept here for backward compatibility.
Definition: basepathfrompolylinequery.h:33
Indicates that a path could not be found between the start and destination points.
Definition: basepathfrompolylinequery.h:39
PathFinderQueryComputeChannelMode m_computeChannelMode
The mode toggling Channels computation.
Definition: ipathfinderquery.h:102
Indicates that the clamping algorithm has completed, but the path has not yet been built...
Definition: basepathfrompolylinequery.h:32
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
KyUInt32 m_numberOfIntersectionTestPerAdvance
The number of intersections that will be processed each frame during the clamper part of the query...
Definition: basepathfrompolylinequery.h:118
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
KyUInt32 m_numberOfRayCastPerAdavance
The number of CanGo tests that will be processed each frame during the refiner part of the query...
Definition: basepathfrompolylinequery.h:115
PositionSpatializationRange m_positionSpatializationRange
The altitude range used to find NavMesh triangles that correspond to the start and destination points...
Definition: basepathfrompolylinequery.h:104
virtual const Vec3f * GetDestination() const
This function is virtual because not all the PathFinders have a preset destination, it may return KY_NULL.
Definition: basepathfrompolylinequery.h:132
Definition: gamekitcrowddispersion.h:20
Indicates that a path has been found between the start and destination.
Definition: basepathfrompolylinequery.h:49
Indicates that one of the rayCast along polyline edge failed.
Definition: basepathfrompolylinequery.h:38
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
Indicates that the computation has been canceled.
Definition: basepathfrompolylinequery.h:45
Indicates that the last point of the polyline is outside the NavMesh.
Definition: basepathfrompolylinequery.h:37
PathFinderResult
Enumerates the possible status of a IPathFinderQuery.
Definition: ipathfinderquery.h:43
Indicates that the path is being clamped to navMesh according to the altitude tolerance.
Definition: basepathfrompolylinequery.h:31
virtual void GetPathFinderTextResult(String &) const
Fills the String with an explanation of the result. Use this to debug your pathfinder query...
Indicates that the provided database is empty (no NavData !)
Definition: basepathfrompolylinequery.h:36
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Indicates that the query has not yet been launched.
Definition: iquery.h:347
Indicates the query has not yet been initialized.
Definition: basepathfrompolylinequery.h:27
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:404
Indicates the query has not yet been launched.
Definition: basepathfrompolylinequery.h:28
Indicates that a computation error caused the query to stop.
Definition: basepathfrompolylinequery.h:44
Indicates that insufficient working memory caused the query to stop.
Definition: basepathfrompolylinequery.h:41
Indicates that the channel is initialized, the channel is being computed.
Definition: basepathfrompolylinequery.h:34
Indicates that the input channelComputerConfig is invalid.
Definition: basepathfrompolylinequery.h:43
The class representing a path.
Definition: path.h:42
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23