9 #ifndef Navigation_AstarQuery_H
10 #define Navigation_AstarQuery_H
62 template<
class TraverseLogic>
63 class AStarQuery :
public BaseAStarQuery
161 virtual void Advance(WorkingMemory* workingMemory);
168 KyFloat32 GetFromOutsideNavMeshDistance()
const;
169 KyFloat32 GetToOutsideNavMeshDistance()
const;
170 KyFloat32 GetPropagationBoxExtent()
const;
171 const Vec3f& GetStartPos()
const;
172 const Vec3f& GetDestPos()
const;
179 Path* GetPath()
const;
180 KyUInt32 GetNumberOfProcessedNodePerFrame()
const;
182 const PositionSpatializationRange& GetPositionSpatializationRange()
const;
184 void ComputePathRefinerConfigInternals();
185 const PathRefinerConfig& GetPathRefinerConfig()
const;
188 bool HasNavDataChanged();
191 void SetFinish(WorkingMemory* workingMemory);
197 KyResult InitDestinationNodeFromDestNavGraphEdge();
198 KyResult InitDestinationNodeFromDestNavGraphVertex();
199 KyResult InitDestinationNodeFromDestNavTriangle();
201 void InitPropagationBounds();
203 KyResult CheckNavDataChangeFromAstarContext(WorkingMemory* workingMemory);
204 KyResult CheckNavDataChange(WorkingMemory* workingMemory);
205 bool HasExplorationReachedDestNode();
207 bool ShouldReturnAfterTryingCanGo(WorkingMemory* workingMemory);
209 KyUInt32 CountAbstractGraphNodes(WorkingMemory* workingMemory, AStarNodeIndex& concreteDestinationNodeIdx);
210 void BuildAbstractPath(WorkingMemory* workingMemory, AStarNodeIndex& concreteDestAStarNodeIndex);
213 class TraversalCustomizer
216 typedef TraverseLogic TLogic;
218 TraversalCustomizer();
223 bool CanEnterNavTag(
const NavTag& exitNavTag,
const NavTag& enterNavTag,
const Vec3f& pos);
224 KyFloat32 GetHeuristicFromNodePosition(
const Vec3f& nodePosition);
227 bool ShouldVisitNode(AStarTraversalContext* aStarTraversalContext, AStarNodeIndex nodeIndex);
228 bool IsNodeOutsidePropagationBounds(AStarTraversalContext* aStarTraversalContext, AStarNodeIndex nodeIndex);
231 bool ShouldOpenAbstractGraphNode(
const AbstractGraphNodeRawPtr& abstractGraphNodeRawPtr);
232 bool ShouldOpenNavTriangleUnderAbstractGraphNode(
const AbstractGraphNodeRawPtr& abstractGraphNodeRawPtr);
233 Vec3f ComputeNodePositionOnHalfEdge(AStarTraversalContext* aStarTraversalContext,
const Vec3f& startPosOfEdge,
const Vec3f& endPosOfEdge, AStarNodeIndex predecessorNodeIndex);
234 KyResult OnNavTriangleExplored(AStarTraversalContext* aStarTraversalContext,
const NavTriangleRawPtr& navTriangleRawPtr, AStarNodeIndex currentNodeIndex);
235 KyResult OnNavGraphEdgeExplored(AStarTraversalContext* aStarTraversalContext,
const NavGraphEdgeRawPtr& navGraphEdgeRawPtr, AStarNodeIndex currentNodeIndex);
244 AStarTraversal<TraversalCustomizer> m_traversal;
251 #endif //Navigation_AstarQuery_H
PathFinderQueryComputeChannelMode
This enum tells if the PathFinderQuery should compute Channels around path sections laying on the Nav...
Definition: ipathfinderquery.h:28
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
This class represents a three-dimensional bounding box with a free orientation on the (X...
Definition: orientedbox2d.h:53
void SetDestNavGraphEdgePtr(const NavGraphEdgePtr &startNavGraphEdgePtr, NavGraphEdgeDirection navGraphEdgePathfindMode)
Optional NavGraph edge you want the dest position must be considered to lie on.
Definition: astarquery.inl:63
void SetChannelComputerConfig(const ChannelComputerConfig &channelComputerConfig)
Write accessor for m_channelComputerConfig.
Definition: astarquery.inl:117
void SetAbstractGraphTraversalMode(PathFinderAbstractGraphTraversalMode abstractGraphTraversalMode)
Write accessor for TraversalParams::m_abstractGraphTraversalMode.
Definition: astarquery.inl:105
Class that aggregates parameters that allow to configure the channel computation of a Bot...
Definition: channelcomputerconfig.h:76
This class is an helper used internaly by the PathFinder Queries to factorize Code.
Definition: pathfinderqueryutils.h:37
virtual void ReleaseWorkingMemoryOnCancelDuringProcess(WorkingMemory *workingMemory=0)
Called when a query is canceled in FlushCommands while its status is QueryInProcess to make sure that...
Definition: astarquery.inl:163
#define KY_NULL
Null value.
Definition: types.h:247
void SetPositionSpatializationRange(const PositionSpatializationRange &positionSpatializationRange)
Write accessor for TraversalParams::m_positionSpatializationRange.
Definition: astarquery.inl:79
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: astarquery.inl:30
Each instance of this class uniquely identifies a single NavGraphEdge in a NavGraph.
Definition: navgraphedgerawptr.h:33
void SetToOutsideNavMeshDistance(KyFloat32 toOutsideNavMeshDistance)
Write accessor for TraversalParams::m_toOutsideNavMeshDistance.
Definition: astarquery.inl:89
void SetNumberOfProcessedNodePerFrame(KyUInt32 numberOfProcessedNodePerFrame)
Write accessor for TraversalParams::m_numberOfVisitedNodePerFrame.
Definition: astarquery.inl:99
void SetStartNavGraphVertexPtr(const NavGraphVertexPtr &startNavGraphVertexPtr)
Optional NavGraph Vertex you want the start position must be considered to be on. ...
Definition: astarquery.inl:57
void SetDestNavGraphVertexPtr(const NavGraphVertexPtr &startNavGraphVertexPtr)
Optional NavGraph Vertex you want the dest position must be considered to be on.
Definition: astarquery.inl:68
void SetPropagationBoxExtent(KyFloat32 propagationBoxExtent)
Write accessor for m_propagationBoxExtent.
Definition: astarquery.inl:94
virtual void Advance(WorkingMemory *workingMemory)
Performs a single iteration of the PathFinder.
Definition: astarquery.inl:227
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
void SetStartNavGraphEdgePtr(const NavGraphEdgePtr &startNavGraphEdgePtr, NavGraphEdgeDirection navGraphEdgePathfindMode)
Optional NavGraph edge you want the start position must be considered to lie on.
Definition: astarquery.inl:52
PathFinderAbstractGraphTraversalMode
Enumerates the possible way of dealing with AbstractGraphs.
Definition: pathfinderabstractgraphtraversalmode.h:16
AStarQueryTryCanGoMode
This enums tells if the AstarQuery should try to perform a RayCanGoQuery from start position to desti...
Definition: baseastarquery.h:70
Definition: gamekitcrowddispersion.h:20
Runs an A-star algorithm to find a Path through the navigation data (NavMesh & NavGraph) from a start...
Definition: astarquery.h:64
Each instance of this class uniquely identifies a single NavGraphVertex in a NavGraph.
Definition: navgraphvertexptr.h:22
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtrianglerawptr.h:30
void SetDestTrianglePtr(const NavTrianglePtr &destTrianglePtr)
The NavMesh triangle that corresponds to m_destPos3f.
Definition: astarquery.inl:47
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
void SetTryCanGoMode(AStarQueryTryCanGoMode tryCanGoMode)
Write accessor for m_tryCanGoMode.
Definition: astarquery.inl:74
void SetStartTrianglePtr(const NavTrianglePtr &startTrianglePtr)
The NavMesh triangle that corresponds to m_startPos3f.
Definition: astarquery.inl:42
void * m_traverseLogicUserData
This userData is typically passed by the Bot.
Definition: iquery.h:278
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
void SetComputeChannelMode(PathFinderQueryComputeChannelMode computeChannelMode)
Write accessor for m_computeChannelMode.
Definition: astarquery.inl:111
Each instance of this class uniquely identifies a singleNavHalfEdge in a NavFloor.
Definition: navhalfedgerawptr.h:34
Each instance of this class uniquely identifies a single NavGraphVertex in a NavGraph.
Definition: navgraphvertexrawptr.h:36
The class representing a path.
Definition: path.h:42
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
void SetFromOutsideNavMeshDistance(KyFloat32 fromOutsideNavMeshDistance)
Write accessor for TraversalParams::m_fromOutsideNavMeshDistance.
Definition: astarquery.inl:84
AStarQueryResult
Enumerates the possible results of an AStarQuery.
Definition: baseastarquery.h:29