gwnavruntime/navmesh/blobs/navcellblob.h Source File

navcellblob.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 
8 
9 // Primary contact: JUBA - secondary contact: NOBODY
10 #ifndef Navigation_NavCellBlob_H
11 #define Navigation_NavCellBlob_H
12 
15 
16 namespace Kaim
17 {
18 
21 class NavCellBlob
22 {
23  KY_ROOT_BLOB_CLASS(NavData, NavCellBlob, 1)
25 public:
26  NavCellBlob() {}
27 
28 
29  const CellPos& GetCellPos() const;
31  const NavFloorBlob& GetNavFloorBlob(NavFloorIdx idx) const;
32 
33 public: // Internal
34  bool IsValid() const;
35 
36 public:
38  // for those 2 blobArray, count == floorCount.
41 };
42 
45 inline void SwapEndianness(Endianness::Target e, NavCellBlob& self)
46 {
47  SwapEndianness(e, self.m_cellPos);
48  SwapEndianness(e, self.m_floor1To1StitchData);
49  SwapEndianness(e, self.m_floors);
50 }
51 
52 KY_INLINE KyUInt32 NavCellBlob::GetNavFloorBlobCount() const { return m_floors.GetCount(); }
53 KY_INLINE const CellPos& NavCellBlob::GetCellPos() const { return m_cellPos; }
54 KY_INLINE const NavFloorBlob& NavCellBlob::GetNavFloorBlob(NavFloorIdx idx) const
55 {
56  KY_DEBUG_ASSERTN(idx < GetNavFloorBlobCount(), ("Invalid NavFloorBlob index"));
57  return *m_floors.GetValues()[idx].Ptr();
58 }
59 
60 }
61 
62 
63 #endif //Navigation_NavCellBlob_H
64 
KyUInt32 GetNavFloorBlobCount() const
Retrieves the number of NavFloorBlob maintained by this NavCellBlob.
Definition: navcellblob.h:57
BlobArray< BlobRef< NavFloorBlob > > m_floors
The list of NavFloorBlobs maintained by the NavCellBlob. Do not modify.
Definition: navcellblob.h:44
const NavFloorBlob & GetNavFloorBlob(NavFloorIdx idx) const
Retrieves the NavFloorBlob with the specified index.
Definition: navcellblob.h:59
The NavFloorBlob contains a connected and not overlapping part of triangle mesh static data within a ...
Definition: navfloorblob.h:42
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:33
The NavCellBlob contains the NavMesh static data of a NavMeshElement at a CellPos.
Definition: navcellblob.h:22
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
CellPos m_cellPos
The position of this NavCellBlob within the partitioning scheme of its NavMeshElementBlob. Do not modify.
Definition: navcellblob.h:41
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
BlobArray< NavFloor1To1StitchDataBlob > m_floor1To1StitchData
The list of NavFloor1To1StitchData maintained by the NavCellBlob. Do not modify.
Definition: navcellblob.h:43
The NavData class is the object containing navigation data that will be added to one Database...
Definition: navdata.h:44
KyUInt32 NavFloorIdx
An index that uniquely identifies a single NavFloor within the set of NavFloors owned by a NavCell...
Definition: navmeshtypes.h:115
bool IsValid() const
performs some basic tests on static data. For internal debug purpose.
This class defines a two-dimensional vector whose coordinates are stored using 32-bit integers...
Definition: vec2i.h:26
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
const CellPos & GetCellPos() const
Retrieves the position of this NavCellBlob within the partitioning scheme of its NavMeshElementBlob.
Definition: navcellblob.h:58