gwnavruntime/navmesh/blobs/navcellblob.h Source File

navcellblob.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 
9 #pragma once
10 
13 
14 namespace Kaim
15 {
16 
20 {
21  KY_ROOT_BLOB_CLASS(NavData, NavCellBlob, 1)
23 public:
24  NavCellBlob() {}
25 
26 
27  const CellPos& GetCellPos() const;
29  const NavFloorBlob& GetNavFloorBlob(NavFloorIdx idx) const;
30 
31 public: // internal
32  bool IsValid() const;
33 
34 public:
36  // for those 2 blobArray, count == floorCount.
39 };
40 
41 inline void SwapEndianness(Endianness::Target e, NavCellBlob& self)
42 {
43  SwapEndianness(e, self.m_cellPos);
44  SwapEndianness(e, self.m_floor1To1StitchData);
45  SwapEndianness(e, self.m_floors);
46 }
47 
48 KY_INLINE KyUInt32 NavCellBlob::GetNavFloorBlobCount() const { return m_floors.GetCount(); }
49 KY_INLINE const CellPos& NavCellBlob::GetCellPos() const { return m_cellPos; }
51 {
52  KY_DEBUG_ASSERTN(idx < GetNavFloorBlobCount(), ("Invalid NavFloorBlob index"));
53  return *m_floors.GetValues()[idx].Ptr();
54 }
55 
56 }
57 
58 
59 
KyUInt32 GetNavFloorBlobCount() const
Retrieves the number of NavFloorBlob maintained by this NavCellBlob.
Definition: navcellblob.h:48
BlobArray< BlobRef< NavFloorBlob > > m_floors
The list of NavFloorBlobs maintained by the NavCellBlob. Do not modify.
Definition: navcellblob.h:38
const NavFloorBlob & GetNavFloorBlob(NavFloorIdx idx) const
Retrieves the NavFloorBlob with the specified index.
Definition: navcellblob.h:50
The NavFloorBlob contains a connected and not overlapping part of triangle mesh static data within a ...
Definition: navfloorblob.h:38
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
The NavCellBlob contains the NavMesh static data of a NavMeshElement at a CellPos.
Definition: navcellblob.h:19
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
CellPos m_cellPos
The position of this NavCellBlob within the partitioning scheme of its NavMeshElementBlob. Do not modify.
Definition: navcellblob.h:35
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
BlobArray< NavFloor1To1StitchDataBlob > m_floor1To1StitchData
The list of NavFloor1To1StitchData maintained by the NavCellBlob. Do not modify.
Definition: navcellblob.h:37
The NavData class is the object containing navigation data that will be added to one Database...
Definition: navdata.h:39
KyUInt32 NavFloorIdx
An index that uniquely identifies a single NavFloor within the set of NavFloors owned by a NavCell...
Definition: navmeshtypes.h:112
bool IsValid() const
performs some basic tests on static data. For internal debug purpose.
Definition: navcellblob.cpp:13
2d vector using KyInt32
Definition: vec2i.h:18
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
const CellPos & GetCellPos() const
Retrieves the position of this NavCellBlob within the partitioning scheme of its NavMeshElementBlob.
Definition: navcellblob.h:49