9 #ifndef Navigation_NavGraphTypes_H
10 #define Navigation_NavGraphTypes_H
19 enum NavGraphEdgeDirection
21 NAVGRAPHEDGE_MONODIRECTIONAL = 0,
22 NAVGRAPHEDGE_BIDIRECTIONAL = 1
31 static const NavGraphVertexType NavGraphVertexType_Unset = 0;
32 static const NavGraphVertexType NavGraphVertexType_InGraphVertex = 1;
33 static const NavGraphVertexType NavGraphVertexType_AddedVertexForFromOutsideLink = 2;
37 typedef KyInt32 NavGraphIdxInActiveData;
38 static const NavGraphIdxInActiveData NavGraphIdxInActiveData_Invalid =
KyInt32MAXVAL;
40 typedef KyUInt16 CompactNavGraphVertexIdx;
41 static const CompactNavGraphVertexIdx CompactNavGraphVertexIdx_MAXVAL = 0xFFFF;
43 typedef KyUInt16 CompactNavGraphNeighborIdx;
44 static const CompactNavGraphNeighborIdx CompactNavGraphNeighborIdx_MAXVAL = 0xFFFF;
50 struct NavGraphEdgeSmartIdx
54 NavGraphEdgeSmartIdx() : m_startVertexIdx(CompactNavGraphVertexIdx_MAXVAL), m_neighborIdx(CompactNavGraphNeighborIdx_MAXVAL) {}
55 NavGraphEdgeSmartIdx(
const NavGraphEdgeSmartIdx& smartIdx) : m_startVertexIdx(smartIdx.m_startVertexIdx), m_neighborIdx(smartIdx.m_neighborIdx) {}
56 NavGraphEdgeSmartIdx(NavGraphVertexIdx startVertexIdx,
KyUInt32 neighborIdx) : m_startVertexIdx((CompactNavGraphVertexIdx)startVertexIdx), m_neighborIdx((CompactNavGraphNeighborIdx)neighborIdx) {}
61 bool operator < (
const NavGraphEdgeSmartIdx& rhs)
const;
62 bool operator ==(
const NavGraphEdgeSmartIdx& rhs)
const;
64 NavGraphVertexIdx GetStartVertexIdx()
const;
65 KyUInt32 GetNeighborVertexIdx()
const;
67 CompactNavGraphVertexIdx m_startVertexIdx;
68 CompactNavGraphNeighborIdx m_neighborIdx;
71 KY_INLINE NavGraphVertexIdx NavGraphEdgeSmartIdx::GetStartVertexIdx()
const {
return (NavGraphVertexIdx)m_startVertexIdx; }
72 KY_INLINE
KyUInt32 NavGraphEdgeSmartIdx::GetNeighborVertexIdx()
const {
return (
KyUInt32)m_neighborIdx; }
73 KY_INLINE
bool NavGraphEdgeSmartIdx::IsValid()
const {
return m_startVertexIdx != CompactNavGraphVertexIdx_MAXVAL && m_neighborIdx != CompactNavGraphNeighborIdx_MAXVAL;}
74 KY_INLINE
void NavGraphEdgeSmartIdx::Invalidate() { m_startVertexIdx = CompactNavGraphVertexIdx_MAXVAL; m_neighborIdx = CompactNavGraphNeighborIdx_MAXVAL; }
76 KY_INLINE
bool NavGraphEdgeSmartIdx::operator < (
const NavGraphEdgeSmartIdx& rhs)
const
78 return GetStartVertexIdx() < rhs.GetStartVertexIdx() || (GetStartVertexIdx() == rhs.GetStartVertexIdx() && GetNeighborVertexIdx() < rhs.GetNeighborVertexIdx());
80 KY_INLINE
bool NavGraphEdgeSmartIdx::operator ==(
const NavGraphEdgeSmartIdx& rhs)
const
82 return GetStartVertexIdx() == rhs.GetStartVertexIdx() && GetNeighborVertexIdx() == rhs.GetNeighborVertexIdx();
87 #endif // Navigation_NavGraphTypes_H
KyUInt16 NavGraphVertexLinkType
Defines a type for a tag that determines whether or not a vertex in a NavGraph should be connected to...
Definition: navgraphtypes.h:26
KyUInt32 NavGraphVertexIdx
An index that uniquely identifies a single vertex within the set of vertices owned by a NavGraph...
Definition: navgraphtypes.h:47
static const NavGraphVertexLinkType NavGraphVertexLinkType_LinkToNavMesh
Indicates that this vertex should be connected to the NavMesh. If the vertex is outside, we try to link it inside.
Definition: navgraphtypes.h:28
static const NavGraphVertexIdx NavGraphVertexIdx_Invalid
Represents an invalid NavGraphVertexIdx.
Definition: navgraphtypes.h:48
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
static const NavGraphVertexLinkType NavGraphVertexLinkType_NoLink
Indicates that this vertex should not be connected to the NavMesh.
Definition: navgraphtypes.h:27
#define KyInt32MAXVAL
The maximum value that can be stored in the KyInt32 variable type.
Definition: types.h:224
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned short KyUInt16
Type used internally to represent an unsigned 16-bit integer.
Definition: types.h:40
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36