7 #ifndef Navigation_AbstractGraphBlob_H
8 #define Navigation_AbstractGraphBlob_H
18 class AbstractGraphCellFloorIndices
21 AbstractGraphCellFloorIndices() {}
22 AbstractGraphCellFloorIndices(CompactAbstractGraphCellIdx graphCellIdx, CompactAbstractGraphFloorIdx graphFloorIdx)
23 : m_abstractCellIdx(graphCellIdx), m_abstractFloorIdx(graphFloorIdx) {}
25 CompactAbstractGraphCellIdx m_abstractCellIdx;
26 CompactAbstractGraphFloorIdx m_abstractFloorIdx;
31 SwapEndianness(e,
self.m_abstractCellIdx);
32 SwapEndianness(e,
self.m_abstractFloorIdx);
36 class AbstractGraphBlob
38 KY_ROOT_BLOB_CLASS(NavData, AbstractGraphBlob, 0)
41 bool IsCompatibleWith(const NavMeshGenParameters& genParameters) const;
45 Vec3f GetNodePosition(AbstractGraphNodeIdx graphNodeIdx, const DatabaseGenMetrics& genMetrics) const;
47 KyFloat32 GetNeighborCost(AbstractGraphNodeIdx fromGraphNodeIdx, AbstractGraphNodeIdx toGraphNodeIdx) const;
50 void GetVertexAndAltitude(AbstractGraphNodeIdx graphNodeIdx, NavVertex& graphNodeVertex,
KyFloat32& altitude) const;
53 NavMeshGenParameters m_navMeshGenParameters;
54 GuidCompound m_navMeshGuidCompound;
56 BitFieldBlob m_cellBoxCoverage;
57 BlobArray<AbstractGraphCellFloorIndices> m_graphNodeIdxToGraphCellFloorIndices;
59 BlobArray<
KyFloat32> m_neighborCostsHalfMatrixBuffer;
61 BlobArray< BlobRef<AbstractGraphCellBlob> > m_abstractCells;
64 inline
void SwapEndianness(Endianness::Target e, AbstractGraphBlob& self)
66 SwapEndianness(e,
self.m_navMeshGenParameters);
67 SwapEndianness(e,
self.m_navMeshGuidCompound);
68 SwapEndianness(e,
self.m_cellBox);
69 SwapEndianness(e,
self.m_graphNodeIdxToGraphCellFloorIndices);
70 SwapEndianness(e,
self.m_neighborCostsHalfMatrixBuffer);
71 SwapEndianness(e,
self.m_abstractCells);
76 KY_INLINE
bool AbstractGraphBlob::IsCompatibleWith(
const NavMeshGenParameters& genParameters)
const
78 return m_navMeshGenParameters == genParameters;
81 KY_INLINE
KyUInt32 AbstractGraphBlob::GetNodeCount()
const
83 return m_graphNodeIdxToGraphCellFloorIndices.GetCount();
86 KY_INLINE Vec3f AbstractGraphBlob::GetNodePosition(AbstractGraphNodeIdx graphNodeIdx,
const DatabaseGenMetrics& genMetrics)
const
88 const AbstractGraphCellFloorIndices& cellFloorIndices = m_graphNodeIdxToGraphCellFloorIndices.GetValues()[graphNodeIdx];
89 const AbstractGraphCellBlob* graphCellBlob = (m_abstractCells.GetValues()[cellFloorIndices.m_abstractCellIdx]).Ptr();
90 return graphCellBlob->GetPosition(graphNodeIdx, cellFloorIndices.m_abstractFloorIdx, genMetrics);
Box2i CellBox
A type that represents a bounding box around cells in a 2D grid.
Definition: navmeshtypes.h:34
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43