15 class NavFloorAndNavGraphEdgeStatusInGrid
19 typedef BitFieldInBuffer CellBits;
22 typedef BitFieldInBuffer VertexBits;
23 typedef ArrayInBuffer<VertexBits> GraphBits;
26 NavFloorAndNavGraphEdgeStatusInGrid() : m_numberOfNavGraph(0) {}
28 NavFloorAndNavGraphEdgeStatusInGrid(WorkingMemory* workingMemory, ActiveData* activeData,
const CellBox& cellBox)
30 , m_numberOfNavGraph(0)
31 , m_cellBitsArrayOffset(0)
32 , m_graphBitsArrayOffset(0)
34 Init(workingMemory, activeData, cellBox);
37 void Init(WorkingMemory* workingMemory, ActiveData* activeData,
const CellBox& cellBox)
39 m_allocBuffer.Init(workingMemory);
41 m_numberOfNavGraph = activeData->GetNavGraphCount();
46 void ReleaseWorkingMemoryBuffer() { m_allocBuffer.ReleaseWorkingMemoryBuffer(); }
51 CellBits* AllocCellBitsArray(
KyUInt32 numberOfNavCell)
53 CellBits* ptr = m_allocBuffer.AllocInBuffer<CellBits>(numberOfNavCell, 0xFF);
54 m_cellBitsArrayOffset = m_allocBuffer.GetOffset(ptr);
57 CellBits* GetCellBitsArray()
const {
return m_allocBuffer.GetPtr<CellBits>(m_cellBitsArrayOffset); }
58 CellBits* GetCellBits(
const CellPos& cellPos)
const {
return GetCellBitsArray() + m_cellBox.GetRowMajorIndex(cellPos); }
61 GraphBits* AllocGraphBitsArray(
KyUInt32 numberOfGraphs)
63 GraphBits* ptr = m_allocBuffer.AllocInBuffer<GraphBits>(numberOfGraphs, 0xFF);
64 m_graphBitsArrayOffset = m_allocBuffer.GetOffset(ptr);
67 GraphBits* GetGraphBitsArray()
const {
return m_allocBuffer.GetPtr<GraphBits>(m_graphBitsArrayOffset); }
68 GraphBits* GetGraphBits(NavGraphIdxInActiveData idx)
const {
return GetGraphBitsArray() + idx; }
71 VertexBits* AllocVertexBitsArray(
KyUInt32 numberOfOutgoingEdges) {
return m_allocBuffer.AllocInBuffer<VertexBits>(numberOfOutgoingEdges, 0xFF); }
74 KyResult OpenNode(ActiveData& activeData,
const NavFloorRawPtr& navFloorRawPtr);
75 bool IsNodeOpen(
const NavFloorRawPtr& navFloorRawPtr)
const;
78 KyResult OpenNode(ActiveData& activeData,
const NavGraphEdgeRawPtr& navGraphEdgeRawPtr);
79 bool IsNodeOpen(
const NavGraphEdgeRawPtr& navGraphEdgeRawPtr)
const;
81 bool IsInitialized()
const {
return m_allocBuffer.IsInitialized(); }
84 AllocatorBuffer m_allocBuffer;
Box2i CellBox
A type that represents a bounding box around cells in a 2D grid.
Definition: navmeshtypes.h:31
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:30
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17