gwnavgeneration/input/inputtileblob.h Source File

inputtileblob.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 // primary contact: GUAL - secondary contact: NOBODY
9 #ifndef GwNavGen_InputTileBlob_H
10 #define GwNavGen_InputTileBlob_H
11 
15 
16 namespace Kaim
17 {
18 
19 typedef Vec2i TilePos;
20 
21 // tilePos and array of InputCellBlob
22 class InputTileBlob
23 {
24  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavDataGen)
25  KY_ROOT_BLOB_CLASS(Generator, InputTileBlob, 0)
26  KY_CLASS_WITHOUT_COPY(InputTileBlob)
27 
28 public:
29  InputTileBlob() {}
30 
31  InputCellBlob* GetInputCellBlob(const CellPos& cellPos)
32  {
33  KyUInt32 index = m_rowMajorMatrix.GetValues()[m_tileCellBox.GetRowMajorIndex(cellPos)];
34  return &m_inputCellBlobs.GetValues()[index];
35  }
36 
37 public:
38  TilePos m_tilePos;
39  CellBox m_tileCellBox;
40  BlobArray<KyUInt32> m_rowMajorMatrix;
41  BlobArray<InputCellBlob> m_inputCellBlobs;
42 };
43 
44 inline void SwapEndianness(Endianness::Target e, InputTileBlob& self)
45 {
46  SwapEndianness(e, self.m_tilePos);
47  SwapEndianness(e, self.m_tileCellBox);
48  SwapEndianness(e, self.m_rowMajorMatrix);
49  SwapEndianness(e, self.m_inputCellBlobs);
50 }
51 
52 }
53 
54 
55 #endif
56 
Box2i CellBox
A type that represents a bounding box around cells in a 2D grid.
Definition: navmeshtypes.h:34
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:33
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
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