62 static const char* s_strs[] =
64 "ASTAR_NOT_INITIALIZED",
65 "ASTAR_NOT_PROCESSED",
67 "ASTAR_PROCESSING_TRAVERSAL",
68 "ASTAR_PROCESSING_TRAVERSAL_DONE",
69 "ASTAR_PROCESSING_ABSTRACT_PATH",
70 "ASTAR_PROCESSING_REFINING_INIT",
71 "ASTAR_PROCESSING_REFINING_RESETCOST",
72 "ASTAR_PROCESSING_REFINING",
73 "ASTAR_PROCESSING_PATHCLAMPING_INIT",
74 "ASTAR_PROCESSING_PATHCLAMPING",
75 "ASTAR_PROCESSING_PATHBUILDING",
76 "ASTAR_PROCESSING_CHANNEL_INIT",
77 "ASTAR_PROCESSING_CHANNEL_COMPUTE",
79 "ASTAR_DONE_START_OUTSIDE",
80 "ASTAR_DONE_START_NAVTAG_FORBIDDEN",
81 "ASTAR_DONE_END_OUTSIDE",
82 "ASTAR_DONE_END_NAVTAG_FORBIDDEN",
83 "ASTAR_DONE_PATH_NOT_FOUND",
84 "ASTAR_DONE_NAVDATA_CHANGED",
85 "ASTAR_DONE_ERROR_LACK_OF_WORKING_MEMORY",
86 "ASTAR_DONE_COMPUTATION_ERROR",
87 "ASTAR_DONE_CHANNELCONFIG_ERROR",
88 "ASTAR_DONE_CHANNELCOMPUTATION_ERROR",
89 "ASTAR_DONE_COMPUTATION_CANCELED",
91 "ASTAR_DONE_DEST_IS_START_NO_PATH",
92 "ASTAR_DONE_PATH_FOUND"
95 static_assert(enumCount ==
sizeof(s_strs) /
sizeof(
const char*),
"AStarQueryResult and its string array have not the same size");
97 return idx >= 0 && idx < enumCount ? s_strs[idx] :
"AStarQueryResult_UNKNOWN";
100 template <
class OSTREAM>
101 inline OSTREAM& operator<<(OSTREAM& os,
AStarQueryResult e) { os << ToString(e);
return os; }
108 static QueryType GetStaticType() {
return TypeAStar; }
109 static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
114 virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
115 virtual void InitFromQueryBlob(
World* world,
void* blob);
116 virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() {
return CreateStaticQueryBlobHandler(); }
133 void Initialize(
const Vec3f& startPos,
const Vec3f& destPos);
161 void SetAbstractGraphTraversalMode(PathFinderAbstractGraphTraversalMode abstractGraphTraversalMode) {
m_abstractGraphTraversalMode = abstractGraphTraversalMode; }
164 void SetChannelComputerConfig(
const ChannelComputerConfig& channelComputerConfig) {
m_channelComputerConfig = channelComputerConfig; }
166 void SetPositionSpatializationRange(
const PositionSpatializationRange& positionSpatializationRange) { m_traversalParams.
m_positionSpatializationRange = positionSpatializationRange; }
167 void SetNumberOfProcessedNodePerFrame(
KyUInt32 numberOfProcessedNodePerFrame) { m_traversalParams.m_numberOfVisitedNodePerAdvance = numberOfProcessedNodePerFrame; }
168 void SetPathClamperFlagMask(PathClamperFlagMask pathClamperFlagMask) {
m_pathClamperFlagMask = pathClamperFlagMask; }
172 Path* GetPath()
const {
return m_path; }
179 const Vec3f& GetStartPos()
const {
return IPathFinderQuery::GetStartPos(); }
184 const Vec3f& GetDestPos()
const {
return m_destPos3f; }
205 KyUInt32 GetNumberOfProcessedNodePerFrame()
const {
return m_traversalParams.m_numberOfVisitedNodePerAdvance; }
208 void ComputePathRefinerConfigInternals() { m_pathRefinerConfig.ComputeInternals(); }
209 const PathRefinerConfig& GetPathRefinerConfig()
const {
return m_pathRefinerConfig; }
213 virtual ~BaseAStarQuery() {}
215 void InitTraversalParamsAndPropagationCellFilter();
216 void ReplaceNodesOfShortestPathOnMiddleOfNavHalfEdge(WorkingMemory* workingMemory);
234 PathRefinerConfig m_pathRefinerConfig;
242 bool m_isStartTriangleHooked;
244 Ptr<CellFilter> m_propagationCellFilter;
ChannelComputerConfig m_channelComputerConfig
The parameter set specific to Channels computation.
Definition: ipathfinderquery.h:86
NavTrianglePtr m_startTrianglePtr
If no m_startTrianglePtr is set, it will be automatically computed from m_startPos3f.
Definition: baseastarquery.h:220
void Invalidate()
Invalidates this object.
Definition: navtriangleptr.h:125
Indicates that a path could not be found between the start and destination points.
Definition: baseastarquery.h:48
Base class for all pathfinder queries.
Definition: ipathfinderquery.h:34
Base class for AstarQuery.
Definition: baseastarquery.h:105
NavGraphEdgeDirection m_startNavGraphEdgeDirection
if NAVGRAPHEDGE_BIDIRECTIONAL query starts also inside m_startNavGraphEdgePtr reverse edge if it exis...
Definition: baseastarquery.h:222
Vec3f m_destInsidePos3f
if m_destInsidePos3f is outside NavMesh it is the computed inside pos in the 2d range of m_toOutsideN...
Definition: baseastarquery.h:241
PathFinderQueryComputeChannelMode
This enum tells if the PathFinderQuery should compute Channels around path sections laying on the Nav...
Definition: ipathfinderquery.h:25
Vec3f m_startInsidePos3f
if m_startPos3f is outside NavMesh it is the computed inside pos in the 2d range of m_fromOutsideNavM...
Definition: baseastarquery.h:240
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
Unused. Kept here for backward compatibility.
Definition: baseastarquery.h:41
virtual const Vec3f * GetDestination() const
This function is virtual because not all the PathFinders have a preset destination, it may return nullptr.
Definition: baseastarquery.h:123
KyFloat32 m_propagationBoxExtent
limits propagation to the (start-dest) segment inflated by m_propagationBoxExtent. default 200.0f
Definition: baseastarquery.h:237
Indicates that a computation error caused the query to stop.
Definition: baseastarquery.h:53
Indicates that insufficient working memory caused the query to stop.
Definition: baseastarquery.h:50
PathClamperFlag
These flags determine if some specific positions must have their altitude clamped on NavMesh...
Definition: pathclamperflag.h:15
void Invalidate()
Invalidates this object.
Definition: navgraphvertexptr.h:101
void SetDestNavGraphVertexPtr(const NavGraphVertexPtr &destNavGraphVertexPtr)
Sets destination to a NavGraphVertex.
Definition: baseastarquery.h:290
Indicates that a computation error caused the query to stop.
Definition: baseastarquery.h:51
void SetStartNavGraphEdgePtr(const NavGraphEdgePtr &startNavGraphEdgePtr, NavGraphEdgeDirection startNavGraphEdgeDirection)
Sets start inside a NavGraphEdge. if startNavGraphEdgeDirection specifies if query can start in rever...
Definition: baseastarquery.h:260
Indicates that the refined path is being clamped to navMesh according to the altitude tolerance...
Definition: baseastarquery.h:39
virtual void GetPathFinderTextResult(String &) const
Fills the String with an explanation of the result. Use this to debug your pathfinder query...
Definition: baseastarquery.cpp:259
virtual QueryType GetType() const
Get query type.
Definition: baseastarquery.h:113
Indicates that the NavTag at the starting point is forbidden.
Definition: baseastarquery.h:45
Indicates the query has not yet been launched.
Definition: baseastarquery.h:30
PathClamperFlagMask m_pathClamperFlagMask
default PathClamperFlag_ClampAll
Definition: baseastarquery.h:235
Indicates that the channel is initialized, the channel is being computed.
Definition: baseastarquery.h:42
NavGraphEdgeDirection m_destNavGraphEdgeDirection
if NAVGRAPHEDGE_BIDIRECTIONAL query ends also inside m_startNavGraphEdgePtr reverse edge if it exists...
Definition: baseastarquery.h:229
void Invalidate()
Invalidates this object.
Definition: navgraphedgeptr.h:116
AStarQueryResult m_result
Updated during processing to indicate the result of the PathFinderQueryResult query.
Definition: baseastarquery.h:248
Indicates that the NavTag at the destination point is forbidden.
Definition: baseastarquery.h:47
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:52
Indicates that the input channelComputerConfig is invalid.
Definition: baseastarquery.h:52
Ptr< Path > m_path
The Path found by the query.
Definition: ipathfinderquery.h:94
PathFinderAbstractGraphTraversalMode m_abstractGraphTraversalMode
default PATHFINDER_TRAVERSE_ABSTRACT_GRAPHS
Definition: baseastarquery.h:236
KyFloat32 m_fromOutsideNavMeshDistance
The maximum distance from the start along the X axis and along the Y axis that will be searched for N...
Definition: traversalparams.h:54
PathFinderQueryTryCanGoMode
This enums tells if a RayCanGoQuery should be performed from start position to destination position b...
Definition: pathfinderquerytrycangomode.h:22
Indicates that the refining process is being initialized.
Definition: baseastarquery.h:35
An internal class that stores parameters used to control the propagation of traversals.
Definition: traversalparams.h:18
PathFinderQueryComputeChannelMode m_computeChannelMode
The mode toggling Channels computation.
Definition: ipathfinderquery.h:85
virtual void DisplayPropagationBounds(DisplayList &displayList) const
Fill the displayList with display info that may help to understand a PathFinderFailure (mainly propag...
Definition: baseastarquery.cpp:297
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: baseastarquery.h:44
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:57
Vec3f m_destPos3f
The destination position.
Definition: baseastarquery.h:226
Indicates that the Astar traversal algorithm has been launched, but has not yet completed.
Definition: baseastarquery.h:32
Indicates the query has not yet been initialized.
Definition: baseastarquery.h:29
Indicates that the refiner is done, but the path has not yet been clamped to the navMesh.
Definition: baseastarquery.h:38
Indicates that the computation has been canceled.
Definition: baseastarquery.h:54
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Ptr< Path > m_abstractPath
The Abstract Path found by the query.
Definition: baseastarquery.h:247
void SetDestTrianglePtr(const NavTrianglePtr &destTrianglePtr)
If no destTrianglePtr is set, it will be automatically computed during the query. Optional input...
Definition: baseastarquery.h:275
Each instance of this class uniquely identifies a single NavGraphVertex in a NavGraph.
Definition: navgraphvertexptr.h:17
NavGraphVertexPtr m_destNavGraphVertexPtr
if valid, query ends at m_startNavGraphVertexPtr
Definition: baseastarquery.h:230
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
void SetStartTrianglePtr(const NavTrianglePtr &startTrianglePtr)
If no startTrianglePtr is set, it will be automatically computed during the query.
Definition: baseastarquery.h:253
PathFinderResult
Enumerates the possible status of a IPathFinderQuery.
Definition: ipathfinderquery.h:38
std::int32_t KyInt32
int32_t
Definition: types.h:24
Indicates that the cost from nodes that are on navMesh are beeing recomputed since they may have been...
Definition: baseastarquery.h:36
NavGraphEdgePtr m_destNavGraphEdgePtr
if valid, query ends inside a NavGraphEdge
Definition: baseastarquery.h:228
NavGraphEdgePtr m_startNavGraphEdgePtr
if valid, query starts inside a NavGraphEdge
Definition: baseastarquery.h:221
Indicates that query starting location and ending location are equals. computing a Path would have le...
Definition: baseastarquery.h:56
NavGraphVertexPtr m_startNavGraphVertexPtr
if valid, query starts at m_startNavGraphVertexPtr
Definition: baseastarquery.h:223
Indicates that the query has stopped and must be relaunched because of a change in the NavData...
Definition: baseastarquery.h:49
Indicates that the clamping algorithm has completed, but the path has not yet been built...
Definition: baseastarquery.h:40
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:17
Indicates that the Astar traversal algorithm traversed AbstractGraph, and the Abstract path is being ...
Definition: baseastarquery.h:34
Indicates that the Astar traversal algorithm is finished, and that a path is found and is prepared to...
Definition: baseastarquery.h:33
Indicates that the query has not yet been launched.
Definition: iquery.h:296
PathFinderQueryTryCanGoMode m_tryCanGoMode
default PATHFINDER_TRY_RAYCANGO_IF_NO_COST
Definition: baseastarquery.h:233
void SetStartNavGraphVertexPtr(const NavGraphVertexPtr &startNavGraphVertexPtr)
Sets start to a NavGraphVertex. Optional input.
Definition: baseastarquery.h:268
Indicates that the destination point of the query is outside the NavMesh.
Definition: baseastarquery.h:46
ChannelArrayComputerResult
ChannelArrayComputerResult.
Definition: channelarraycomputerresult.h:13
PositionSpatializationRange m_positionSpatializationRange
The altitude range used to find NavMesh triangles that correspond to the start and destination points...
Definition: traversalparams.h:46
Each instance of this class uniquely identifies a single and mono-directionnal NavGraphEdge in a NavG...
Definition: navgraphedgeptr.h:20
Indicates that a path has been found between the start and destination.
Definition: baseastarquery.h:57
void BindToDatabase(Database *database)
Binds the query with database, clears inputs and results, sets the configuration to defaults...
Definition: baseastarquery.cpp:59
Indicates that the path found is being refined.
Definition: baseastarquery.h:37
void SetDestNavGraphEdgePtr(const NavGraphEdgePtr &destNavGraphEdgePtr, NavGraphEdgeDirection destNavGraphEdgeDirection)
Sets destination inside a NavGraphEdge. destNavGraphEdgeDirection specifies if query can start in rev...
Definition: baseastarquery.h:282
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16
NavTrianglePtr m_destTrianglePtr
If no m_destTrianglePtr is set, it will be automatically computed from m_destPos3f.
Definition: baseastarquery.h:227
KyFloat32 m_toOutsideNavMeshDistance
The maximum distance from the destination along the X axis and along the Y axis that will be searched...
Definition: traversalparams.h:62
AStarQueryResult
Enumerates the possible results of an AStarQuery.
Definition: baseastarquery.h:27