gwnavgeneration/input/inputtileblob.h Source File

inputtileblob.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 typedef Vec2i TilePos;
18 
19 // tilePos and array of InputCellBlob
20 class InputTileBlob
21 {
22  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavDataGen)
23  KY_ROOT_BLOB_CLASS(Generator, InputTileBlob, 0)
24  KY_CLASS_WITHOUT_COPY(InputTileBlob)
25 
26 public:
27  InputTileBlob() {}
28 
29  InputCellBlob* GetInputCellBlob(const CellPos& cellPos)
30  {
31  KyUInt32 index = m_rowMajorMatrix.GetValues()[m_tileCellBox.GetRowMajorIndex(cellPos)];
32  return &m_inputCellBlobs.GetValues()[index];
33  }
34 
35 public:
36  TilePos m_tilePos;
37  CellBox m_tileCellBox;
38  BlobArray<KyUInt32> m_rowMajorMatrix;
39  BlobArray<InputCellBlob> m_inputCellBlobs;
40 };
41 
42 inline void SwapEndianness(Endianness::Target e, InputTileBlob& self)
43 {
44  SwapEndianness(e, self.m_tilePos);
45  SwapEndianness(e, self.m_tileCellBox);
46  SwapEndianness(e, self.m_rowMajorMatrix);
47  SwapEndianness(e, self.m_inputCellBlobs);
48 }
49 
50 }
51 
52 
53 
Box2i CellBox
A type that represents a bounding box around cells in a 2D grid.
Definition: navmeshtypes.h:31
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:30
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17