gwnavruntime/navgraph/navgraphlink.h Source File

navgraphlink.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 
8 #pragma once
9 
13 
14 namespace Kaim
15 {
16 
17 class NavGraphLink
18 {
19  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
20 
21 public:
22  NavGraphLink(const NavGraphVertexRawPtr& navGraphVertexRawPtr);
23 
24  void Set(const NavTriangleRawPtr& triangleRawPtr);
25 
26  bool IsValid() const { return GetIndexInCollection() != KyUInt16MAXVAL; }
27 
28  KyUInt32 GetIndexInCollection() const;
29  void SetIndexInCollection(KyUInt32 indexInCollection);
30 
31 public:
32  KyUInt16 m_indexInFloorCollection; // for remove O(1) in the collection of the NavFloor
33 
34  NavGraphVertexRawPtr m_navGraphVertexRawPtr;
35  NavTriangleRawPtr m_navTriangleRawPtr;
36 };
37 
38 KY_INLINE NavGraphLink::NavGraphLink(const NavGraphVertexRawPtr& navGraphVertexRawPtr) :
39  m_indexInFloorCollection(KyUInt16MAXVAL),
40  m_navGraphVertexRawPtr(navGraphVertexRawPtr)
41 {}
42 
43 KY_INLINE void NavGraphLink::Set(const NavTriangleRawPtr& triangleRawPtr) { m_navTriangleRawPtr = triangleRawPtr; }
44 
45 KY_INLINE KyUInt32 NavGraphLink::GetIndexInCollection() const { return m_indexInFloorCollection; }
46 KY_INLINE void NavGraphLink::SetIndexInCollection(KyUInt32 indexInCollection) { m_indexInFloorCollection = (KyUInt16)indexInCollection; }
47 
48 }
49 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
std::uint16_t KyUInt16
uint16_t
Definition: types.h:28
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
#define KyUInt16MAXVAL
KyUInt16 max value
Definition: types.h:67