11 #ifndef Navigation_NavGraph_H
12 #define Navigation_NavGraph_H
21 class ConnectedNavGraph;
22 class NavGraphMemoryManager;
36 bool IsStillLoaded()
const;
37 bool IsActive()
const;
40 const NavGraphEdgeInfo& GetNavGraphEdgeInfo(
const NavGraphEdgeSmartIdx& edgeIdInGraph)
const;
43 void SetIdxInTheActiveDataBuffer(NavGraphIdxInActiveData idxInTheBufferOfStitchedGraph);
44 NavGraphIdxInActiveData GetIdxInTheActiveDataBuffer()
const;
47 GraphEdgeData& GetEdgeData(NavGraphEdgeSmartIdx navGraphEdgeSmartIdx)
const;
49 KyUInt32 GetIdxInTheBufferOfNavGraph()
const {
return GetIndexInCollection(); }
51 KyUInt32 GetIndexInCollection()
const {
return m_indexInCollection; }
52 void SetIndexInCollection(
KyUInt32 indexInCollection) { m_indexInCollection = indexInCollection; }
54 void ComputeAllCellPosOfVerticesAndCellBox();
57 static Ptr<NavGraph> Create(
const NavGraphBlob* navGraphBlob,
Database* database, MemoryHeap* pheap = 0);
59 void DebugCheckIsStillLoaded()
const;
64 NavGraphIdxInActiveData m_idxInTheActiveDataBuffer;
68 GraphVertexData* m_vertexDatas;
69 GraphEdgeData* m_edgeDatas;
74 KY_INLINE
void NavGraph::DebugCheckIsStillLoaded()
const
76 KY_LOG_ERROR_IF(IsStillLoaded() ==
false,(
"You Cannot call this function if graph has been unloaded"));
79 KY_INLINE
const NavGraphBlob* NavGraph::GetNavGraphBlob()
const
81 DebugCheckIsStillLoaded();
82 return m_navGraphBlob;
85 KY_INLINE
void NavGraph::SetIdxInTheActiveDataBuffer(NavGraphIdxInActiveData idxInTheBufferOfStitchedGraph)
87 DebugCheckIsStillLoaded();
88 m_idxInTheActiveDataBuffer = idxInTheBufferOfStitchedGraph;
90 KY_INLINE NavGraphIdxInActiveData NavGraph::GetIdxInTheActiveDataBuffer()
const
92 DebugCheckIsStillLoaded();
93 return m_idxInTheActiveDataBuffer;
96 KY_INLINE GraphVertexData& NavGraph::GetGraphVertexData(
NavGraphVertexIdx vertexIdx)
const
98 DebugCheckIsStillLoaded();
99 return m_vertexDatas[vertexIdx];
101 KY_INLINE GraphEdgeData& NavGraph::GetEdgeData(NavGraphEdgeSmartIdx navGraphEdgeSmartIdx)
const
103 DebugCheckIsStillLoaded();
104 return m_edgeDatas[m_vertexDatas[navGraphEdgeSmartIdx.GetStartVertexIdx()].m_startIdxInEdgeDataArray + navGraphEdgeSmartIdx.GetNeighborVertexIdx()];
107 KY_INLINE
bool NavGraph::IsActive()
const {
return GetIdxInTheActiveDataBuffer() != NavGraphIdxInActiveData_Invalid; }
108 KY_INLINE
bool NavGraph::IsStillLoaded()
const {
return m_navGraphBlob !=
KY_NULL; }
109 KY_INLINE
void NavGraph::OnRemove() { m_navGraphBlob =
KY_NULL; }
115 #endif //Navigation_NavGraph_H
The NavGraphBlob contains the static data of a NavGraph.
Definition: navgraphblob.h:21
KyUInt32 NavGraphVertexIdx
An index that uniquely identifies a single vertex within the set of vertices owned by a NavGraph...
Definition: navgraphtypes.h:47
This class represents a two-dimensional axis-aligned bounding box whose dimensions are stored using 3...
Definition: box2i.h:119
#define KY_REFCOUNT_MALLOC_FREE(ClassName)
Specific to RefCounting, no inheritance involved, used to make RefCount-able classes compatible with ...
Definition: memory.h:145
#define KY_NULL
Null value.
Definition: types.h:247
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
The NavData class is the object containing navigation data that will be added to one Database...
Definition: navdata.h:44
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
This class is a runtime wrapper of a NavGraphBlob, it gathers all the runtime information associated ...
Definition: navgraph.h:27