89 static const AStarNodeIndex AStarNodeIndex_FirstDestNode = 1;
94 PathFinderPoint() { Clear(); }
99 m_trianglePtr.Invalidate();
100 m_navGraphEdgePtr[0].Invalidate();
101 m_navGraphEdgePtr[1].Invalidate();
102 m_navGraphVertexPtr.Invalidate();
103 m_navGraphVertexPtr.Invalidate();
106 void SetPosition(
const Vec3f& pos3f) { m_pos3f = pos3f; }
107 void SetTrianglePtr(
const NavTrianglePtr& destTrianglePtr);
108 void SetNavGraphEdgePtr(
const NavGraphEdgePtr& startNavGraphEdgePtr, NavGraphEdgeDirection navGraphEdgePathfindMode);
109 void SetNavGraphVertexPtr(
const NavGraphVertexPtr& startNavGraphVertexPtr);
112 NavTrianglePtr m_trianglePtr;
113 NavGraphEdgePtr m_navGraphEdgePtr[2];
114 NavGraphVertexPtr m_navGraphVertexPtr;
123 static QueryType GetStaticType() {
return TypeMultiDestinationPathFinderQuery; }
125 virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
126 virtual void InitFromQueryBlob(
World* world,
void* blob);
127 virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() {
return CreateStaticQueryBlobHandler(); }
128 static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
134 const Vec3f& GetStartPos()
const {
return m_start.m_pos3f; }
135 const NavTrianglePtr& GetStartTrianglePtr()
const {
return m_start.m_trianglePtr; }
136 const NavGraphEdgePtr& GetStartNavGraphEdgePtr()
const {
return m_start.m_navGraphEdgePtr[0]; }
137 const NavGraphVertexPtr& GetStartNavGraphVertexPtr()
const {
return m_start.m_navGraphVertexPtr; }
139 KyUInt32 GetDestCount()
const {
return m_destinations.GetCount(); }
140 const Vec3f& GetDestPos(
KyUInt32 destIdx)
const {
return m_destinations[destIdx].m_pos3f; }
141 const NavTrianglePtr& GetDestTrianglePtr(
KyUInt32 destIdx)
const {
return m_destinations[destIdx].m_trianglePtr; }
142 const NavGraphEdgePtr& GetDestNavGraphEdgePtr(
KyUInt32 destIdx)
const {
return m_destinations[destIdx].m_navGraphEdgePtr[0]; }
143 const NavGraphVertexPtr& GetDestNavGraphVertexPtr(
KyUInt32 destIdx)
const {
return m_destinations[destIdx].m_navGraphVertexPtr; }
149 KyUInt32 GetNumberOfProcessedNodePerFrame()
const {
return m_traversalParams.m_numberOfVisitedNodePerAdvance; }
150 Path* GetPath(
KyUInt32 destIdx)
const {
return m_paths[destIdx]; }
151 Path* GetAbstractPath(
KyUInt32 destIdx)
const {
return m_abstractPaths[destIdx]; }
156 void ComputePathRefinerConfigInternals() { m_pathRefinerConfig.ComputeInternals();}
157 const PathRefinerConfig& GetPathRefinerConfig()
const {
return m_pathRefinerConfig; }
158 void SetPathClamperFlagMask(PathClamperFlagMask pathClamperFlagMask) { m_pathClamperFlagMask = pathClamperFlagMask; }
160 KyUInt32 GetNavigationProfileId()
const {
return m_navigationProfileId; }
164 void BindToDatabase(
Database* database);
165 void Initialize(
const PathFinderPoint& start);
166 void AddDestination(
const PathFinderPoint& additionalDest);
171 void SetChannelComputerConfig(
const ChannelComputerConfig& channelComputerConfig) {
m_channelComputerConfig = channelComputerConfig; }
172 void SetPropagationFilter(Ptr<CellFilter> propagationFilter) { m_propagationCellFilter = propagationFilter; }
173 void SetPositionSpatializationRange(
const PositionSpatializationRange& positionSpatializationRange) { m_traversalParams.
m_positionSpatializationRange = positionSpatializationRange; }
176 void SetNumberOfProcessedNodePerFrame(
KyUInt32 numberOfProcessedNodePerFrame) { m_traversalParams.m_numberOfVisitedNodePerAdvance = numberOfProcessedNodePerFrame; }
177 void SetAbstractGraphTraversalMode(PathFinderAbstractGraphTraversalMode abstractGraphTraversalMode) { m_abstractGraphTraversalMode = abstractGraphTraversalMode; }
178 void SetNavigationProfileId(
KyUInt32 navigationProfileId) { m_navigationProfileId = navigationProfileId; }
181 BaseMultiDestinationPathFinderQuery();
182 virtual ~BaseMultiDestinationPathFinderQuery() {}
185 void InitTraversalParamsAndPropagationCellFilter();
187 void ReplaceNodesOfShortestPathOnMiddleOfNavHalfEdge(WorkingMemory* workingMemory);
190 Path* GetRawPath(
KyUInt32 destIdx)
const {
return m_rawPaths[destIdx]; }
201 KyUInt32 m_lastAdvanceDatabaseChangeIdx;
203 bool m_isStartTriangleHooked;
204 PathFinderPoint m_start;
208 PathRefinerConfig m_pathRefinerConfig;
210 PathFinderAbstractGraphTraversalMode m_abstractGraphTraversalMode;
212 Ptr<CellFilter> m_propagationCellFilter;
225 Ptr<Path> m_currentRawPath;
231 KY_INLINE
void PathFinderPoint::SetTrianglePtr(
const NavTrianglePtr& trianglePtr)
233 m_trianglePtr = trianglePtr;
234 KY_LOG_WARNING_IF(m_navGraphEdgePtr[0].IsValid(), (
"You are setting a NavTrianglePtr whereas a NavGraphEdgePtr was set too."));
235 KY_LOG_WARNING_IF(m_navGraphVertexPtr.IsValid(), (
"You are setting a NavTrianglePtr whereas a NavGraphVertexPtr was set too."));
236 m_navGraphEdgePtr[0].Invalidate();
237 m_navGraphEdgePtr[1].Invalidate();
238 m_navGraphVertexPtr.Invalidate();
241 KY_INLINE
void PathFinderPoint::SetNavGraphEdgePtr(
const NavGraphEdgePtr& navGraphEdgePtr, NavGraphEdgeDirection navGraphEdgePathfindMode)
243 m_navGraphEdgePtr[0] = navGraphEdgePtr;
244 if(navGraphEdgePathfindMode == NAVGRAPHEDGE_BIDIRECTIONAL)
245 m_navGraphEdgePtr[1] = navGraphEdgePtr.GetOppositeNavGraphEdgePtr();
247 m_navGraphEdgePtr[1].Invalidate();
249 KY_LOG_WARNING_IF(m_trianglePtr.IsValid(), (
"You are setting a NavGraphEdgePtr whereas a NavTrianglePtr was set too."));
250 KY_LOG_WARNING_IF(m_navGraphVertexPtr.IsValid(), (
"You are setting a NavGraphEdgePtr whereas a NavGraphVertexPtr was set too."));
251 m_trianglePtr.Invalidate();
252 m_navGraphVertexPtr.Invalidate();
255 KY_INLINE
void PathFinderPoint::SetNavGraphVertexPtr(
const NavGraphVertexPtr& navGraphVertexPtr)
257 m_navGraphVertexPtr = navGraphVertexPtr;
258 KY_LOG_WARNING_IF(m_trianglePtr.IsValid(), (
"You are setting a NavGraphVertexPtr whereas a NavTrianglePtr was set too."));
259 KY_LOG_WARNING_IF(m_navGraphEdgePtr[0].IsValid(), (
"You are setting a NavGraphVertexPtr whereas a NavGraphEdgePtr was set too."));
260 m_trianglePtr.Invalidate();
261 m_navGraphEdgePtr[0].Invalidate();
262 m_navGraphEdgePtr[1].Invalidate();
KyUInt32 m_finalOutputMode
cf enum MultiDestinationPathFinderFinalOutput
Definition: basemultidestinationpathfinderquery.h:200
#define KyFloat32MAXVAL
KyFloat32 max value
Definition: types.h:71
Indicates that the cost from nodes that are on navMesh are beeing recomputed since they may have been...
Definition: basemultidestinationpathfinderquery.h:44
Indicates that insufficient working memory caused the query to stop.
Definition: basemultidestinationpathfinderquery.h:60
Indicates that all destination points are either outside or in forbidden navtag.
Definition: basemultidestinationpathfinderquery.h:55
PathFinderQueryComputeChannelMode
This enum tells if the PathFinderQuery should compute Channels around path sections laying on the Nav...
Definition: ipathfinderquery.h:25
Indicates that the refiner is done, the channel is going to be initialized for one destination...
Definition: basemultidestinationpathfinderquery.h:49
For Debug Only, fulfill m_rawPaths, no refining, no clamping, no channel making paths unsuitable for ...
Definition: basemultidestinationpathfinderquery.h:84
void SetFinalOutputMode(KyUInt32 finalOutputMode)
cf MultiDestinationPathFinderFinalOutput enum
Definition: basemultidestinationpathfinderquery.h:168
Indicates that the astar traversal algorithm has been launched, but has not yet completed.
Definition: basemultidestinationpathfinderquery.h:36
ChannelComputerConfig m_channelComputerConfig
The parameter set specific to Channels computation.
Definition: basemultidestinationpathfinderquery.h:198
Indicates that the destination point is currently processed (from MULTIDESTINATIONPATHFINDER_PROCESSI...
Definition: basemultidestinationpathfinderquery.h:70
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
Indicates that the computation has been canceled.
Definition: basemultidestinationpathfinderquery.h:64
PathClamperFlag
These flags determine if some specific positions must have their altitude clamped on NavMesh...
Definition: pathclamperflag.h:15
Fulfill m_paths with refined, clamped paths with channels and m_abstractPaths for paths going through...
Definition: basemultidestinationpathfinderquery.h:85
Class that aggregates parameters that allow to configure the channel computation of a Bot...
Definition: channelcomputerconfig.h:89
Base class for MultiDestinationPathFinderQuery.
Definition: basemultidestinationpathfinderquery.h:120
Indicates that the refining process is being initialized for one destination.
Definition: basemultidestinationpathfinderquery.h:43
Indicates that no path was found for any destinations.
Definition: basemultidestinationpathfinderquery.h:57
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: basemultidestinationpathfinderquery.h:62
Indicates that initial CanGoQuery reached a dest from start, and the path from this dest is being com...
Definition: basemultidestinationpathfinderquery.h:40
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 a path could not be found between the start and destination point. ...
Definition: basemultidestinationpathfinderquery.h:73
An internal class that stores parameters used to control the propagation of traversals.
Definition: traversalparams.h:18
Indicates the query has not yet been initialized.
Definition: basemultidestinationpathfinderquery.h:32
Base class for all the queries that need to be time-sliced.
Definition: iquery.h:262
Indicates that the clamping algorithm has completed, but the path has not yet been built...
Definition: basemultidestinationpathfinderquery.h:48
Indicates that a path has been found between the start and destination.
Definition: basemultidestinationpathfinderquery.h:75
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
Indicates that the NavTag at the destination point is forbidden.
Definition: basemultidestinationpathfinderquery.h:72
Indicates that the astar traversal algorithm is finished, and that the path found is ready to be refi...
Definition: basemultidestinationpathfinderquery.h:37
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:57
virtual QueryType GetType() const
Get query type.
Definition: basemultidestinationpathfinderquery.h:124
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the channel is initialized, the channel is being computed for one destination.
Definition: basemultidestinationpathfinderquery.h:50
Indicates that query starting location and ending location are equals, computing a Path would have le...
Definition: basemultidestinationpathfinderquery.h:74
Indicates that the refiner is done, but the path has not yet been clamped to the navMesh.
Definition: basemultidestinationpathfinderquery.h:46
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
Indicates some or all destinations have a path or an abstract path.
Definition: basemultidestinationpathfinderquery.h:66
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basemultidestinationpathfinderquery.h:53
Indicates that the astar traversal algorithm traversed AbstractGraph, and an Abstract path is being b...
Definition: basemultidestinationpathfinderquery.h:42
CAnGoQuery validated the reachability, Path will be built from the query.
Definition: basemultidestinationpathfinderquery.h:69
KyUInt32 GetFinalOutputMode() const
possible returned values are defined by MultiDestinationPathFinderFinalOutput enum ...
Definition: basemultidestinationpathfinderquery.h:162
Indicates that a computation error caused the query to stop.
Definition: basemultidestinationpathfinderquery.h:63
Indicates that all destinations are equals to starting location, computing a Path would have lead to ...
Definition: basemultidestinationpathfinderquery.h:56
Fulfill m_rawCosts.
Definition: basemultidestinationpathfinderquery.h:83
Gathers all runtime flags used to debug internal algorithms (mostly PathFinder).
Definition: fulldebug.h:14
Build m_path or m_abstractPath to the destination with the lowest cost.
Definition: basemultidestinationpathfinderquery.h:82
Indicates that the query has stopped and must be relaunched because of a change in the NavData...
Definition: basemultidestinationpathfinderquery.h:59
MultiDestinationPathFinderQueryResult
Enumerates the possible results of an AStarQuery.
Definition: basemultidestinationpathfinderquery.h:30
PathFinderQueryComputeChannelMode m_computeChannelMode
The mode toggling Channels computation.
Definition: basemultidestinationpathfinderquery.h:197
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:17
Indicates that the NavTag at the starting point is forbidden.
Definition: basemultidestinationpathfinderquery.h:54
Indicates that a computation error caused the query to stop.
Definition: basemultidestinationpathfinderquery.h:61
Indicates that the query has not yet been launched.
Definition: iquery.h:296
Indicates the query has not yet been launched.
Definition: basemultidestinationpathfinderquery.h:33
Indicates that the refined path of one destination is being clamped to navMesh according to the altit...
Definition: basemultidestinationpathfinderquery.h:47
PositionSpatializationRange m_positionSpatializationRange
The altitude range used to find NavMesh triangles that correspond to the start and destination points...
Definition: traversalparams.h:46
Indicates that initial CanGoQuery did not reach a dest from start, so a path must be built from the t...
Definition: basemultidestinationpathfinderquery.h:41
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:273
Indicates that the path found is being refined for one destination.
Definition: basemultidestinationpathfinderquery.h:45
MultiDestinationPathFinderFinalOutput
Usually only one of MultiDestinationPathFinderFinalOutput values is useful, but for debug purpose...
Definition: basemultidestinationpathfinderquery.h:80
float KyFloat32
float
Definition: types.h:32
Indicates that the destination point is outside the NavMesh.
Definition: basemultidestinationpathfinderquery.h:71
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