26 class TraversalVisitNodeContext
29 TraversalVisitNodeContext() {}
33 NavGraphVertexRawPtr m_visitedGraphVertexRawPtr;
34 AStarNodeIndex m_visitedNodeIndex;
37 template<
class TraversalCustomzier>
42 typedef typename TraversalCustomzier::TLogic TraverseLogic;
45 AStarTraversal() : m_traversalCustomizer(), m_astarContext(
nullptr), m_traversalParams(
nullptr) {}
46 AStarTraversal(
const TraversalCustomzier& customizer) : m_traversalCustomizer(customizer), m_astarContext(nullptr), m_traversalParams(nullptr) {}
48 KyResult InitializeContextAndStartNode(QueryUtils& queryUtils,
const Vec3f& startPos3f,
const NavTrianglePtr& startTrianglePtr);
49 KyResult InitializeContextAndStartNode(QueryUtils& queryUtils,
const Vec3f& startPos3f,
const NavGraphEdgePtr& startNavGraphEdgePtr);
50 KyResult InitializeContextAndStartNode(QueryUtils& queryUtils,
const Vec3f& startPos3f,
const NavGraphVertexPtr& startNavGraphVertexPtr);
53 KyResult InitializeDestNode(
const Vec3f& destPos,
const NavTrianglePtr& destTrianglePtr);
54 KyResult InitializeDestNode(
const Vec3f& destPos,
const NavGraphEdgePtr& destNavGraphEdgePtr);
55 KyResult InitializeDestNode(
const NavGraphVertexPtr& destNavGraphVertexPtr);
57 KyResult ExploreAllNodesInTriangle(ActiveData* activeData,
const NavTriangleRawPtr& triangleRawPtr, AStarNodeIndex currentNodeIndex);
59 KyResult ExploreAllNodesInNavGraphEdge(ActiveData* activeData,
const Vec3f& posOnEdge,
const NavGraphEdgeRawPtr& navGraphEdgeRawPtr, AStarNodeIndex currentNodeIndex, NavGraphEdgeDirection m_navGraphEdgePathfindMode);
61 KY_INLINE
bool IsThereNodeToVisit() {
return m_astarContext->m_traversalBinHeap.IsEmpty() ==
false; }
64 KyResult VisitNode(QueryUtils& queryUtils, TraversalVisitNodeContext& visitNodeContext);
65 KyResult UpdateOpenedOrClosedNode(AStarNodeIndex neighborNodeIndex, AStarNodeIndex currentNodeIndex,
69 KyResult ExploreNeighborsOfHalfEdgeNode(ActiveData* activeData, AStarNodeIndex indexOfOpenWithLowerCost,
const NavHalfEdgeRawPtr& currentEdgeRawPtr,
70 const NavHalfEdgeRawPtr& pairHalfEdgeRawPtr,
const Vec3f& nodePosition,
const LogicDoNotUseCanEnterNavTag&);
71 KyResult ExploreNeighborsOfHalfEdgeNode(ActiveData* activeData, AStarNodeIndex indexOfOpenWithLowerCost,
const NavHalfEdgeRawPtr& currentEdgeRawPtr,
72 const NavHalfEdgeRawPtr& pairHalfEdgeRawPtr,
const Vec3f& nodePosition,
const LogicDoUseCanEnterNavTag&);
74 KyResult ExploreNeighborsOfHalfEdgeNode(ActiveData* activeData, AStarNodeIndex indexOfOpenWithLowerCost,
const NavHalfEdgeRawPtr& halfEdgeRawPtr);
75 KyResult ExploreNeighborsOfGraphVertexNode(ActiveData* activeData, AStarNodeIndex indexOfOpenWithLowerCost, NavGraphVertexRawPtr& visitedGraphVertexRawPtr);
76 KyResult ExploreNeighborsOfAbstractGraphNode(AStarNodeIndex currentCostNodeIndex,
const AbstractGraphNodeRawPtr& currentAbstractNodeRawPtr);
78 KyResult ExploreHalfEdgesOfTriangle(ActiveData* activeData,
const NavTriangleRawPtr& triangleRawPtr, AStarNodeIndex currentNodeIndex);
79 KyResult ExploreGraphVerticesInTriangle(
const NavTriangleRawPtr& triangleRawPtr, AStarNodeIndex currentNodeIndex);
80 KyResult ExploreAbstractGraphNodesInTriangle(
const NavTriangleRawPtr& triangleRawPtr, AStarNodeIndex currentNodeIndex);
82 KyResult ExploreAbstractGraphNodesOnNavHalEdgeRawPtr(
const NavHalfEdgeRawPtr& navHalfEdgeRawPtr, AStarNodeIndex currentNodeIndex);
84 KyResult CreateNewHalfEdgeNode(ActiveData* activeData,
const NavHalfEdgeRawPtr& HalfEdge,
const NavHalfEdgeRawPtr& pairHalfEdge,
85 const Vec3f& startPosOfEdge,
const Vec3f& endPosOfEdge, AStarNodeIndex predecessorIndex);
87 KyResult CreateNewGraphVertexNode(
const NavGraphVertexRawPtr& navGraphVertexRawPtr, AStarNodeIndex predecessorIndex,
89 KyResult CreateNewAbstractGraphNode(
const AbstractGraphNodeRawPtr& abstractGraphNodeRawPtr,
const AbstractGraphNodeRawPtr& pairedAbstractGraphNodeRawPtr,
90 AStarNodeIndex predecessorNodeIndex,
KyFloat32 costFromCurrentNode);
92 KyResult OpenOrUpdateGraphVertex(
const NavGraphVertexRawPtr& navGraphVertexRawPtr, AStarNodeIndex vertexNodeIndex, AStarNodeIndex currentNodeIndex,
95 KyResult OpenOrUpdateHalfEdge(ActiveData* activeData,
const NavHalfEdgeRawPtr& halfEdge, AStarNodeIndex halfEdgeNodeIndex,
96 const Vec3f& startPosOfEdge,
const Vec3f& endPosOfEdge, AStarNodeIndex currentNodeIndex);
98 KyResult OpenOrUpdateAbstractGraphNode(
const AbstractGraphNodeRawPtr& neighborAbstractNodeRawPtr,
99 AStarNodeIndex neighborAstarNodeIndex, AStarNodeIndex currentNodeIndex,
KyFloat32 costFromCurrentNode);
101 bool ShouldOpenHalfEdgeNode(
const NavHalfEdgeRawPtr& halfEdge, NavHalfEdgeRawPtr& pairHalfEdgeOfNewNode);
102 bool ShouldOpenGraphVertexNode(
const NavGraphVertexRawPtr& navGraphVertexRawPtr);
103 bool ShouldOpenAbstractGraphNode(
const AbstractGraphNodeRawPtr& abstractGraphNodeRawPtr, AbstractGraphNodeRawPtr& pairedAbstractGraphNodeRawPtr);
105 bool CanTraverseNavTriangle(
const NavTriangleRawPtr& triangle);
106 bool CanTraverseNavTriangleAndGetCost(
const NavTriangleRawPtr& triangle,
const Vec3f& A,
const Vec3f& B,
KyFloat32& cost,
KyFloat32& costMultiplier);
107 bool CanTraverseGraphEdgeAndGetCost(
const NavGraphEdgeRawPtr& edge,
const Vec3f& A,
const Vec3f& B,
KyFloat32& cost,
KyFloat32& costMultiplier);
109 KyFloat32 EvaluateCostToDest(
const Vec3f& nodePosition);
112 KyResult InitializeInvalidDestNode();
115 TraversalCustomzier m_traversalCustomizer;
117 AStarTraversalContext* m_astarContext;
118 TraversalParameters* m_traversalParams;
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
float KyFloat32
float
Definition: types.h:32