21 class NavHalfEdgeRawPtr;
23 class AbstractGraphNodeRawPtr
27 AbstractGraphNodeRawPtr() { Invalidate(); }
28 AbstractGraphNodeRawPtr(AbstractGraph* abstractGraph, AbstractGraphNodeIdx nodeIdx) { Set(abstractGraph, nodeIdx); }
30 KyResult InitFromNavHalfEdgeRawPtr(
const NavHalfEdgeRawPtr& navHalfEdgeRawPtr);
32 bool IsValid()
const {
return m_abstractGraph !=
nullptr && m_nodeIdx < AbstractGraphNodeIdx_Invalid; }
35 void Set(AbstractGraph* abstractGraph, AbstractGraphNodeIdx nodeIdx);
37 KyFloat32 GetNeighborCost(AbstractGraphNodeIdx abstractGraphNodeIdx)
const;
39 AbstractGraphNodeRawPtr GetPairedAbstractGraphNodeRawPtr()
const;
40 const AbstractGraphNodeLink& GetAbstractGraphNodeLink()
const;
45 Vec3f GetPosition()
const;
47 AbstractGraphCellGrid* GetAbstractGraphCellGrid()
const;
49 AbstractGraph* m_abstractGraph;
50 AbstractGraphNodeIdx m_nodeIdx;
55 KY_INLINE
void AbstractGraphNodeRawPtr::Invalidate()
57 m_abstractGraph =
nullptr;
58 m_nodeIdx = AbstractGraphNodeIdx_Invalid;
61 KY_INLINE
void AbstractGraphNodeRawPtr::Set(AbstractGraph* abstractGraph, AbstractGraphNodeIdx nodeIdx)
63 m_abstractGraph = abstractGraph;
67 KY_INLINE
KyFloat32 AbstractGraphNodeRawPtr::GetNeighborCost(AbstractGraphNodeIdx abstractGraphNodeIdx)
const
69 return m_abstractGraph->GetNeighborCost(m_nodeIdx, abstractGraphNodeIdx);
72 KY_INLINE
const AbstractGraphNodeLink& AbstractGraphNodeRawPtr::GetAbstractGraphNodeLink()
const {
return m_abstractGraph->m_links[m_nodeIdx]; }
73 KY_INLINE AbstractGraphNodeRawPtr AbstractGraphNodeRawPtr::GetPairedAbstractGraphNodeRawPtr()
const
75 const LoadedAbstractGraphNodeIdx& pairedNodeIdx = GetAbstractGraphNodeLink().m_pairedNodeIdx;
76 if (pairedNodeIdx.IsValid() ==
false)
77 return AbstractGraphNodeRawPtr();
79 AbstractGraphNodeRawPtr pairedNode;
80 pairedNode.m_abstractGraph = GetAbstractGraphCellGrid()->GetAbstractGraph(pairedNodeIdx);
81 pairedNode.m_nodeIdx = pairedNodeIdx.m_nodeIdx;
85 KY_INLINE AbstractGraphCellGrid* AbstractGraphNodeRawPtr::GetAbstractGraphCellGrid()
const {
return m_abstractGraph->GetAbstractGraphCellGrid(); }
87 KY_INLINE
NavFloorIdx AbstractGraphNodeRawPtr::GetOriginalNavFloorIdx()
const
89 const AbstractGraphCellFloorIndices& indices = m_abstractGraph->m_blob->m_graphNodeIdxToGraphCellFloorIndices.GetValues()[m_nodeIdx];
90 const AbstractGraphCellBlob* abstractCellBlob = m_abstractGraph->m_blob->m_abstractCells.GetValues()[indices.m_abstractCellIdx].Ptr();
91 return abstractCellBlob->m_abstractFloors.GetValues()[indices.m_abstractFloorIdx].Ptr()->m_originalNavFloorIdx;
94 KY_INLINE
CellPos AbstractGraphNodeRawPtr::GetCellPos()
const
96 const AbstractGraphCellFloorIndices& indices = m_abstractGraph->m_blob->m_graphNodeIdxToGraphCellFloorIndices.GetValues()[m_nodeIdx];
97 const AbstractGraphCellBlob* abstractCellBlob = m_abstractGraph->m_blob->m_abstractCells.GetValues()[indices.m_abstractCellIdx].Ptr();
98 return abstractCellBlob->m_cellPos;
101 KY_INLINE
CardinalDir AbstractGraphNodeRawPtr::GetCellBoundary()
const
103 const AbstractGraphCellFloorIndices& indices = m_abstractGraph->m_blob->m_graphNodeIdxToGraphCellFloorIndices.GetValues()[m_nodeIdx];
104 const AbstractGraphCellBlob* abstractCellBlob = m_abstractGraph->m_blob->m_abstractCells.GetValues()[indices.m_abstractCellIdx].Ptr();
105 const AbstractGraphFloorBlob* abstractFloorBlob = abstractCellBlob->m_abstractFloors.GetValues()[indices.m_abstractFloorIdx].Ptr();
106 return abstractFloorBlob->GetCellBoundaryDir(m_nodeIdx);
109 KY_INLINE Vec3f AbstractGraphNodeRawPtr::GetPosition()
const
111 return m_abstractGraph->GetNodePosition(m_nodeIdx);
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:30
KyUInt32 CardinalDir
Defines a type that refers to one of the cardinal points on the compass:
Definition: cardinaldir.h:15
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
KyUInt32 NavFloorIdx
An index that uniquely identifies a single NavFloor within the set of NavFloors owned by a NavCell...
Definition: navmeshtypes.h:112
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
float KyFloat32
float
Definition: types.h:32