gwnavruntime/navgraph/blobs/navgraphblobbuildertypes.h Source File

navgraphblobbuildertypes.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
12 
13 namespace Kaim
14 {
15 
16 class NavGraphBlobBuilder_Vertex
17 {
18  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
19 public:
20  NavGraphBlobBuilder_Vertex() : m_navTagIdx(0), m_vertexType(NavGraphVertexLinkType_LinkToNavMesh), m_vertexIdx(KyUInt32MAXVAL) {}
21  NavGraphBlobBuilder_Vertex(const Vec3f& position, KyUInt32 navTagIdx, NavGraphVertexLinkType vertexType, KyUInt32 vertexIdx) :
22  m_position(position), m_navTagIdx(navTagIdx), m_vertexType(vertexType), m_vertexIdx(vertexIdx) {}
23 
24 public:
25  Vec3f m_position; //< Position of the vertex.
26  KyUInt32 m_navTagIdx;
27  NavGraphVertexLinkType m_vertexType;
28  KyUInt32 m_vertexIdx;
29  KyArray<KyUInt32> m_outgoingEdgesIdx; //< outgoing edges.
30 };
31 
32 // Contains all basic data of a graph edge.
33 class NavGraphBlobBuilder_Edge
34 {
35  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
36 public:
37  NavGraphBlobBuilder_Edge(): m_startVertexIdx(KyUInt32MAXVAL), m_endVertexIdx(KyUInt32MAXVAL), m_navTagIdx(0) {}
38  NavGraphBlobBuilder_Edge(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, KyUInt32 navTagIdx) :
39  m_startVertexIdx(startVertexIdx), m_endVertexIdx(endVertexIdx), m_navTagIdx(navTagIdx)
40  {
41  KY_LOG_ERROR_IF(startVertexIdx == endVertexIdx, ("Creation of an illegal circular edge."));
42  }
43 
44 public:
45  KyUInt32 m_startVertexIdx; //< start vertex.
46  KyUInt32 m_endVertexIdx; //< end vertex.
47  KyUInt32 m_navTagIdx;
48 };
49 
50 }
51 
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:24
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
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:26
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
#define KyUInt32MAXVAL
KyUInt32 max value
Definition: types.h:68