9 #ifndef Navigation_BaseMultiDestinationPathFinderQueryResult_H
10 #define Navigation_BaseMultiDestinationPathFinderQueryResult_H
76 enum MultiDestinationPathFinderTryCanGoMode
78 MULTIDESTINATIONPATHFINDER_DO_NOT_TRY_RAYCANGO = 0,
79 MULTIDESTINATIONPATHFINDER_DO_TRY_RAYCANGO = 1
93 static const AStarNodeIndex AStarNodeIndex_FirstDestNode = 1;
98 PathFinderPoint() { Clear(); }
103 m_trianglePtr.Invalidate();
104 m_navGraphEdgePtr[0].Invalidate();
105 m_navGraphEdgePtr[1].Invalidate();
106 m_navGraphVertexPtr.Invalidate();
107 m_navGraphVertexPtr.Invalidate();
110 void SetPosition(
const Vec3f& pos3f);
111 void SetTrianglePtr(
const NavTrianglePtr& destTrianglePtr);
112 void SetNavGraphEdgePtr(
const NavGraphEdgePtr& startNavGraphEdgePtr, NavGraphEdgeDirection navGraphEdgePathfindMode);
113 void SetNavGraphVertexPtr(
const NavGraphVertexPtr& startNavGraphVertexPtr);
116 NavTrianglePtr m_trianglePtr;
117 NavGraphEdgePtr m_navGraphEdgePtr[2];
118 NavGraphVertexPtr m_navGraphVertexPtr;
124 class BaseMultiDestinationPathFinderQuery :
public ITimeSlicedQuery
127 static QueryType GetStaticType() {
return TypeMultiDestinationPathFinderQuery; }
128 virtual QueryType GetType()
const {
return TypeMultiDestinationPathFinderQuery; }
129 virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
130 virtual void InitFromQueryBlob(World* world,
void* blob);
131 virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() {
return CreateStaticQueryBlobHandler(); }
132 static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
137 KyFloat32 GetFromOutsideNavMeshDistance()
const;
138 KyFloat32 GetToOutsideNavMeshDistance()
const;
140 Ptr<CellFilter> GetPropagationCellFilter()
const;
154 MultiDestinationPathFinderTryCanGoMode GetTryCanGoMode()
const;
157 KyUInt32 GetNumberOfProcessedNodePerFrame()
const;
162 const PositionSpatializationRange& GetPositionSpatializationRange()
const;
164 void ComputePathRefinerConfigInternals();
165 const PathRefinerConfig& GetPathRefinerConfig()
const;
166 void SetPathClamperFlagMask(PathClamperFlagMask pathClamperFlagMask);
168 KyUInt32 GetNavigationProfileId()
const;
173 void BindToDatabase(
Database* database);
174 void Initialize(
const PathFinderPoint& start);
175 void AddDestination(
const PathFinderPoint& additionalDest);
178 void SetTryCanGoMode(MultiDestinationPathFinderTryCanGoMode tryCanGoMode);
181 void SetPropagationFilter(Ptr<CellFilter> propagationFilter);
182 void SetPositionSpatializationRange(
const PositionSpatializationRange& positionSpatializationRange);
183 void SetFromOutsideNavMeshDistance(
KyFloat32 fromOutsideNavMeshDistance);
184 void SetToOutsideNavMeshDistance(
KyFloat32 toOutsideNavMeshDistance);
185 void SetNumberOfProcessedNodePerFrame(
KyUInt32 numberOfProcessedNodePerFrame);
187 void SetNavigationProfileId(
KyUInt32 navigationProfileId);
194 void InitCellFilterFromAbstractGraph();
202 MultiDestinationPathFinderTryCanGoMode m_tryCanGoMode;
208 PathFinderPoint m_start;
212 PathRefinerConfig m_pathRefinerConfig;
213 PathClamperFlagMask m_pathClamperFlagMask;
215 Ptr<CellFilter> m_propagationCellFilter;
227 Ptr<Path> m_currentRawPath;
230 bool m_enableAdvancedVisualDebug;
234 KY_INLINE
void PathFinderPoint::SetPosition(
const Vec3f& pos3f) { m_pos3f = pos3f; }
236 KY_INLINE
void PathFinderPoint::SetTrianglePtr(
const NavTrianglePtr& trianglePtr)
238 m_trianglePtr = trianglePtr;
239 KY_LOG_WARNING_IF(m_navGraphEdgePtr[0].IsValid(), (
"You are setting a NavTrianglePtr whereas a NavGraphEdgePtr was set too."));
240 KY_LOG_WARNING_IF(m_navGraphVertexPtr.IsValid(), (
"You are setting a NavTrianglePtr whereas a NavGraphVertexPtr was set too."));
241 m_navGraphEdgePtr[0].Invalidate();
242 m_navGraphEdgePtr[1].Invalidate();
243 m_navGraphVertexPtr.Invalidate();
246 KY_INLINE
void PathFinderPoint::SetNavGraphEdgePtr(
const NavGraphEdgePtr& navGraphEdgePtr, NavGraphEdgeDirection navGraphEdgePathfindMode)
248 m_navGraphEdgePtr[0] = navGraphEdgePtr;
249 if(navGraphEdgePathfindMode == NAVGRAPHEDGE_BIDIRECTIONAL)
254 KY_LOG_WARNING_IF(m_trianglePtr.IsValid(), (
"You are setting a NavGraphEdgePtr whereas a NavTrianglePtr was set too."));
255 KY_LOG_WARNING_IF(m_navGraphVertexPtr.IsValid(), (
"You are setting a NavGraphEdgePtr whereas a NavGraphVertexPtr was set too."));
256 m_trianglePtr.Invalidate();
257 m_navGraphVertexPtr.Invalidate();
260 KY_INLINE
void PathFinderPoint::SetNavGraphVertexPtr(
const NavGraphVertexPtr& navGraphVertexPtr)
262 m_navGraphVertexPtr = navGraphVertexPtr;
263 KY_LOG_WARNING_IF(m_trianglePtr.IsValid(), (
"You are setting a NavGraphVertexPtr whereas a NavTrianglePtr was set too."));
264 KY_LOG_WARNING_IF(m_navGraphEdgePtr[0].IsValid(), (
"You are setting a NavGraphVertexPtr whereas a NavGraphEdgePtr was set too."));
265 m_trianglePtr.Invalidate();
266 m_navGraphEdgePtr[0].Invalidate();
267 m_navGraphEdgePtr[1].Invalidate();
271 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetTryCanGoMode(MultiDestinationPathFinderTryCanGoMode tryCanGoMode) { m_tryCanGoMode = tryCanGoMode; }
274 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetChannelComputerConfig(
const ChannelComputerConfig& channelComputerConfig) {
m_channelComputerConfig = channelComputerConfig; }
275 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetPropagationFilter(Ptr<CellFilter> propagationFilter) { m_propagationCellFilter = propagationFilter; }
281 KY_INLINE
const Vec3f& BaseMultiDestinationPathFinderQuery::GetStartPos()
const {
return m_start.m_pos3f; }
282 KY_INLINE
const NavTrianglePtr& BaseMultiDestinationPathFinderQuery::GetStartTrianglePtr()
const {
return m_start.m_trianglePtr; }
283 KY_INLINE
const NavGraphEdgePtr& BaseMultiDestinationPathFinderQuery::GetStartNavGraphEdgePtr()
const {
return m_start.m_navGraphEdgePtr[0]; }
284 KY_INLINE
const NavGraphVertexPtr& BaseMultiDestinationPathFinderQuery::GetStartNavGraphVertexPtr()
const {
return m_start.m_navGraphVertexPtr; }
286 KY_INLINE
KyUInt32 BaseMultiDestinationPathFinderQuery::GetDestCount()
const {
return m_destinations.GetCount(); }
287 KY_INLINE
const Vec3f& BaseMultiDestinationPathFinderQuery::GetDestPos(
KyUInt32 destIdx)
const {
return m_destinations[destIdx].m_pos3f; }
288 KY_INLINE
const NavTrianglePtr& BaseMultiDestinationPathFinderQuery::GetDestTrianglePtr(
KyUInt32 destIdx)
const {
return m_destinations[destIdx].m_trianglePtr; }
289 KY_INLINE
const NavGraphEdgePtr& BaseMultiDestinationPathFinderQuery::GetDestNavGraphEdgePtr(
KyUInt32 destIdx)
const {
return m_destinations[destIdx].m_navGraphEdgePtr[0]; }
290 KY_INLINE
const NavGraphVertexPtr& BaseMultiDestinationPathFinderQuery::GetDestNavGraphVertexPtr(
KyUInt32 destIdx)
const {
return m_destinations[destIdx].m_navGraphVertexPtr; }
293 KY_INLINE MultiDestinationPathFinderTryCanGoMode BaseMultiDestinationPathFinderQuery::GetTryCanGoMode()
const {
return m_tryCanGoMode; }
294 KY_INLINE Path* BaseMultiDestinationPathFinderQuery::GetPath(
KyUInt32 destIdx)
const {
return m_paths[destIdx]; }
295 KY_INLINE Path* BaseMultiDestinationPathFinderQuery::GetAbstractPath(
KyUInt32 destIdx)
const {
return m_abstractPaths[destIdx]; }
296 KY_INLINE Path* BaseMultiDestinationPathFinderQuery::GetRawPath(
KyUInt32 destIdx)
const {
return m_rawPaths[destIdx]; }
297 KY_INLINE
KyFloat32 BaseMultiDestinationPathFinderQuery::GetRawCost(
KyUInt32 destIdx)
const {
return m_rawCosts[destIdx]; }
299 KY_INLINE
const ChannelComputerConfig& BaseMultiDestinationPathFinderQuery::GetChannelComputerConfig()
const {
return m_channelComputerConfig; }
300 KY_INLINE Ptr<CellFilter> BaseMultiDestinationPathFinderQuery::GetPropagationCellFilter()
const {
return m_propagationCellFilter; }
303 KY_INLINE
KyFloat32 BaseMultiDestinationPathFinderQuery::GetFromOutsideNavMeshDistance()
const {
return m_traversalParams.GetFromOutsideNavMeshDistance(); }
304 KY_INLINE
KyFloat32 BaseMultiDestinationPathFinderQuery::GetToOutsideNavMeshDistance()
const {
return m_traversalParams.GetToOutsideNavMeshDistance(); }
305 KY_INLINE
KyUInt32 BaseMultiDestinationPathFinderQuery::GetNumberOfProcessedNodePerFrame()
const {
return m_traversalParams.GetNumberOfProcessedNodePerFrame(); }
308 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetFromOutsideNavMeshDistance(
KyFloat32 fromOutsideNavMeshDistance)
310 m_traversalParams.SetFromOutsideNavMeshDistance(fromOutsideNavMeshDistance);
312 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetToOutsideNavMeshDistance(
KyFloat32 toOutsideNavMeshDistance)
314 m_traversalParams.SetToOutsideNavMeshDistance(toOutsideNavMeshDistance);
316 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetNumberOfProcessedNodePerFrame(
KyUInt32 numberOfProcessedNodePerFrame)
318 m_traversalParams.SetNumberOfProcessedNodePerFrame(numberOfProcessedNodePerFrame);
320 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetPositionSpatializationRange(
const PositionSpatializationRange& positionSpatializationRange)
322 m_traversalParams.SetPositionSpatializationRange(positionSpatializationRange);
327 m_traversalParams.SetAbstractGraphTraversalMode(abstractGraphTraversalMode);
331 KY_INLINE
const PositionSpatializationRange& BaseMultiDestinationPathFinderQuery::GetPositionSpatializationRange()
const {
return m_traversalParams.GetPositionSpatializationRange(); }
333 KY_INLINE
void BaseMultiDestinationPathFinderQuery::ComputePathRefinerConfigInternals() { m_pathRefinerConfig.ComputeInternals();}
334 KY_INLINE
const PathRefinerConfig& BaseMultiDestinationPathFinderQuery::GetPathRefinerConfig()
const {
return m_pathRefinerConfig;}
335 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetPathClamperFlagMask(PathClamperFlagMask pathClamperFlagMask) { m_pathClamperFlagMask = pathClamperFlagMask; }
337 KY_INLINE
void BaseMultiDestinationPathFinderQuery::SetNavigationProfileId(
KyUInt32 navigationProfileId) { m_navigationProfileId = navigationProfileId; }
338 KY_INLINE
KyUInt32 BaseMultiDestinationPathFinderQuery::GetNavigationProfileId()
const {
return m_navigationProfileId; }
342 #endif //Navigation_BaseMultiDestinationPathFinderQueryResult_H
KyUInt32 m_finalOutputMode
cf enum MultiDestinationPathFinderFinalOutput
Definition: basemultidestinationpathfinderquery.h:234
#define KyFloat32MAXVAL
The maximum value that can be stored in the KyFloat32 variable type.
Definition: types.h:227
Indicates that insufficient working memory caused the query to stop.
Definition: basemultidestinationpathfinderquery.h:70
Indicates that all destination points are either outside or in forbidden navtag.
Definition: basemultidestinationpathfinderquery.h:65
PathFinderQueryComputeChannelMode
This enum tells if the PathFinderQuery should compute Channels around path sections laying on the Nav...
Definition: ipathfinderquery.h:28
Indicates that the refiner is done, the channel is going to be initialized for one destination...
Definition: basemultidestinationpathfinderquery.h:55
NavGraphEdgePtr GetOppositeNavGraphEdgePtr() const
Return the opposite NavGraphEdgePtr, if any exists.
For Debug Only, fulfill m_rawPaths, no refining, no clamping, no channel making paths unsuitable for ...
Definition: basemultidestinationpathfinderquery.h:104
void SetFinalOutputMode(KyUInt32 finalOutputMode)
cf MultiDestinationPathFinderFinalOutput enum
Definition: basemultidestinationpathfinderquery.h:301
Indicates that the astar traversal algorithm has been launched, but has not yet completed.
Definition: basemultidestinationpathfinderquery.h:40
ChannelComputerConfig m_channelComputerConfig
The parameter set specific to Channels computation.
Definition: basemultidestinationpathfinderquery.h:233
Indicates that the destination point is currently processed (from MULTIDESTINATIONPATHFINDER_PROCESSI...
Definition: basemultidestinationpathfinderquery.h:84
Indicates that the computation has been canceled.
Definition: basemultidestinationpathfinderquery.h:74
KyUInt32 m_dataBaseChangeIdx
Stores the revision of the Database when the Path has been computed.
Definition: basemultidestinationpathfinderquery.h:235
Fulfill m_paths with refined, clamped paths with channels, or m_abstractPaths for paths going through...
Definition: basemultidestinationpathfinderquery.h:105
Class that aggregates parameters that allow to configure the channel computation of a Bot...
Definition: channelcomputerconfig.h:76
Base class for MultiDestinationPathFinderQuery.
Definition: basemultidestinationpathfinderquery.h:142
Indicates that the refining process is being initialized for one destination.
Definition: basemultidestinationpathfinderquery.h:50
void Invalidate()
Invalidates this object.
Definition: navgraphedgeptr.h:130
Indicates that no path was found for any destinations.
Definition: basemultidestinationpathfinderquery.h:67
Indicates that the input channelComputerConfig is invalid.
Definition: basemultidestinationpathfinderquery.h:72
Indicates that initial CanGoQuery reached a dest from start, and the path from this dest is being com...
Definition: basemultidestinationpathfinderquery.h:48
Indicates that a path could not be found between the start and destination point. ...
Definition: basemultidestinationpathfinderquery.h:87
An internal class that stores parameters used to control the propagation of traversals through the Na...
Definition: traversalparams.h:23
Indicates the query has not yet been initialized.
Definition: basemultidestinationpathfinderquery.h:32
Indicates that the clamping algorithm has completed, but the path has not yet been built...
Definition: basemultidestinationpathfinderquery.h:54
Indicates that a path has been found between the start and destination.
Definition: basemultidestinationpathfinderquery.h:89
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
Indicates that the NavTag at the destination point is forbidden.
Definition: basemultidestinationpathfinderquery.h:86
Indicates that the astar traversal algorithm is finished, and that the path found is ready to be refi...
Definition: basemultidestinationpathfinderquery.h:41
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
PathFinderAbstractGraphTraversalMode
Enumerates the possible way of dealing with AbstractGraphs.
Definition: pathfinderabstractgraphtraversalmode.h:16
MultiDestinationPathFinderQueryResult m_result
Updated during processing to indicate the result of the PathFinderQueryResult query.
Definition: basemultidestinationpathfinderquery.h:253
Definition: gamekitcrowddispersion.h:20
Indicates that the channel is initialized, the channel is being computed for one destination.
Definition: basemultidestinationpathfinderquery.h:56
Indicates that query starting location and ending location are equals, computing a Path would have le...
Definition: basemultidestinationpathfinderquery.h:88
Indicates that the refiner is done, but the path has not yet been clamped to the navMesh.
Definition: basemultidestinationpathfinderquery.h:52
Each instance of this class uniquely identifies a single NavGraphVertex in a NavGraph.
Definition: navgraphvertexptr.h:22
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
Indicates some or all destinations have a path or an abstract path.
Definition: basemultidestinationpathfinderquery.h:76
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basemultidestinationpathfinderquery.h:63
Indicates that the astar traversal algorithm traversed AbstractGraph, and an Abstract path is being b...
Definition: basemultidestinationpathfinderquery.h:49
CAnGoQuery validated the reachability, Path will be built from the query.
Definition: basemultidestinationpathfinderquery.h:83
KyUInt32 GetFinalOutputMode() const
///< possible="" returned="" values="" are="" defined="" by="" multidestinationpathfinderfinaloutput="" enum="" />
Definition: basemultidestinationpathfinderquery.h:310
Indicates that a computation error caused the query to stop.
Definition: basemultidestinationpathfinderquery.h:73
Indicates that all destinations are equals to starting location, computing a Path would have lead to ...
Definition: basemultidestinationpathfinderquery.h:66
Fulfill m_rawCosts.
Definition: basemultidestinationpathfinderquery.h:103
Build m_path or m_abstractPath to the destination with the lowest cost.
Definition: basemultidestinationpathfinderquery.h:102
Indicates that the query has stopped and must be relaunched because of a change in the NavData...
Definition: basemultidestinationpathfinderquery.h:69
MultiDestinationPathFinderQueryResult
Enumerates the possible results of an AStarQuery.
Definition: basemultidestinationpathfinderquery.h:30
PathFinderQueryComputeChannelMode m_computeChannelMode
The mode toggling Channels computation.
Definition: basemultidestinationpathfinderquery.h:232
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
Indicates that the NavTag at the starting point is forbidden.
Definition: basemultidestinationpathfinderquery.h:64
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Indicates that a computation error caused the query to stop.
Definition: basemultidestinationpathfinderquery.h:71
Indicates that the query has not yet been launched.
Definition: iquery.h:347
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:53
Each instance of this class uniquely identifies a single and mono-directionnal NavGraphEdge in a NavG...
Definition: navgraphedgeptr.h:25
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 that the path found is being refined for one destination.
Definition: basemultidestinationpathfinderquery.h:51
The class representing a path.
Definition: path.h:42
MultiDestinationPathFinderFinalOutput
Usually only one of MultiDestinationPathFinderFinalOutput values is useful, but for debug purpose...
Definition: basemultidestinationpathfinderquery.h:100
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
Indicates that the destination point is outside the NavMesh.
Definition: basemultidestinationpathfinderquery.h:85