24 static const AStarNodeIndex AStarNodeIndex_Invalid =
KyUInt32MAXVAL;
25 static const AStarNodeIndex AStarNodeIndex_StartNode = 0;
26 static const AStarNodeIndex AStarNodeIndex_DestNode = 1;
30 static const PathNodeType NodeType_NavMeshEdge = 0;
31 static const PathNodeType NodeType_NavGraphVertex = 1;
32 static const PathNodeType NodeType_AbstractGraphNode = 2;
33 static const PathNodeType NodeType_FreePositionOnNavMesh = 3;
34 static const PathNodeType NodeType_FreePositionOnGraphEdge = 4;
36 class NodeTypeAndRawPtrDataIdx
40 NodeTypeAndRawPtrDataIdx(PathNodeType aStarNodeType,
KyUInt32 indexOfRawPtrData) :
41 m_data((indexOfRawPtrData & 0x1FFFFFFF) | (aStarNodeType << 29))
43 KY_ASSERT((aStarNodeType & 0xFFFFFFF8) == 0);
46 PathNodeType GetNodeType()
const {
return (PathNodeType)(m_data >> 29); }
47 KyUInt32 GetIdxOfRawPtrData()
const {
return m_data & 0x1FFFFFFF; }
48 void SetNodeType(PathNodeType nodeType) { m_data = (m_data & 0x1FFFFFFF) | (nodeType << 29); }
50 void SetIdxOfRawPtrData(
KyUInt32 indexOfRawPtrData) { m_data = (indexOfRawPtrData & 0x1FFFFFFF) | (GetNodeType() << 29); }
61 m_estimatedCostToDest(0.f),
62 m_costMultiplierFromPredecessor(1.f),
63 m_indexOfPredecessor(AStarNodeIndex_Invalid),
64 m_indexInBinaryHeap(IndexInBinHeap_UnSet)
67 AStarNode(AStarNodeIndex indexOfPredecessor,
const Vec3f& pos, PathNodeType aStarNodeType,
KyUInt32 indexOfRawPtrData) :
70 m_estimatedCostToDest(0.f),
71 m_costMultiplierFromPredecessor(1.f),
72 m_nodeTypeAndRawPtrDataIdx(aStarNodeType, indexOfRawPtrData),
73 m_indexOfPredecessor(indexOfPredecessor),
74 m_indexInBinaryHeap(IndexInBinHeap_UnSet)
77 AStarNodeIndex GetIndexOfPredecessor()
const {
return m_indexOfPredecessor; }
78 void SetIndexOfPredecessor(AStarNodeIndex indexOfPredecessor) { m_indexOfPredecessor = indexOfPredecessor; }
80 PathNodeType GetNodeType()
const {
return m_nodeTypeAndRawPtrDataIdx.GetNodeType(); }
81 KyUInt32 GetIdxOfRawPtrData()
const {
return m_nodeTypeAndRawPtrDataIdx.GetIdxOfRawPtrData(); }
83 void SetNodeType(PathNodeType nodeType) { m_nodeTypeAndRawPtrDataIdx.SetNodeType(nodeType); }
84 void SetIdxOfRawPtrData(
KyUInt32 indexOfRawPtrData) { m_nodeTypeAndRawPtrDataIdx.SetIdxOfRawPtrData(indexOfRawPtrData); }
90 KyFloat32 m_costMultiplierFromPredecessor;
91 NodeTypeAndRawPtrDataIdx m_nodeTypeAndRawPtrDataIdx;
92 AStarNodeIndex m_indexOfPredecessor;
93 IndexInBinHeap m_indexInBinaryHeap;
#define KyFloat32MAXVAL
KyFloat32 max value
Definition: types.h:71
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
#define KyUInt8MAXVAL
KyUInt8 max value
Definition: types.h:66
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
std::uint8_t KyUInt8
uint8_t
Definition: types.h:27
#define KyUInt32MAXVAL
KyUInt32 max value
Definition: types.h:68
float KyFloat32
float
Definition: types.h:32