gwnavruntime/navgraph/blobs/navgraphblobbuildertypes.h Source File

navgraphblobbuildertypes.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 // Primary contact: LASI - secondary contact: NONE
8 #ifndef Navigation_NavGraphBlobBuilderTypes_H
9 #define Navigation_NavGraphBlobBuilderTypes_H
10 
14 
15 namespace Kaim
16 {
17 
18 class NavGraphBlobBuilder_Vertex
19 {
20  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
21 public:
22  NavGraphBlobBuilder_Vertex() : m_navTagIdx(0), m_vertexType(NavGraphVertexLinkType_LinkToNavMesh), m_vertexIdx(KyUInt32MAXVAL) {}
23  NavGraphBlobBuilder_Vertex(const Vec3f& position, KyUInt32 navTagIdx, NavGraphVertexLinkType vertexType, KyUInt32 vertexIdx) :
24  m_position(position), m_navTagIdx(navTagIdx), m_vertexType(vertexType), m_vertexIdx(vertexIdx) {}
25 
26 public:
27  Vec3f m_position; //< Position of the vertex.
28  KyUInt32 m_navTagIdx;
29  NavGraphVertexLinkType m_vertexType;
30  KyUInt32 m_vertexIdx;
31  KyArray<KyUInt32> m_outgoingEdgesIdx; //< outgoing edges.
32 };
33 
34 // Contains all basic data of a graph edge.
35 class NavGraphBlobBuilder_Edge
36 {
37  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
38 public:
39  NavGraphBlobBuilder_Edge(): m_startVertexIdx(KyUInt32MAXVAL), m_endVertexIdx(KyUInt32MAXVAL), m_navTagIdx(0) {}
40  NavGraphBlobBuilder_Edge(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, KyUInt32 navTagIdx) :
41  m_startVertexIdx(startVertexIdx), m_endVertexIdx(endVertexIdx), m_navTagIdx(navTagIdx)
42  {
43  KY_LOG_ERROR_IF(startVertexIdx == endVertexIdx, ("Creation of an illegal circular edge."));
44  }
45 
46 public:
47  KyUInt32 m_startVertexIdx; //< start vertex.
48  KyUInt32 m_endVertexIdx; //< end vertex.
49  KyUInt32 m_navTagIdx;
50 };
51 
52 }
53 
54 #endif // #define Navigation_NavGraphBlobBuilderTypes_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
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
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
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226