9 #ifndef GwNavGen_PixelAndCellGrid_H
10 #define GwNavGen_PixelAndCellGrid_H
91 class PixelAndCellGrid
93 typedef GridUtils Utils;
100 m_nbPixelsOnCellSide = 0;
101 m_pixelEnlargement = 0;
102 m_coordEnlargement = 0;
111 m_nbPixelsOnCellSide = cellSizeInPixel;
113 m_pixelSize = IntCoordSystem::IntPixelSize();
114 m_cellSize = m_pixelSize * m_nbPixelsOnCellSide;
116 m_pixelEnlargement = entityRadiusInPixel + 3;
117 m_coordEnlargement = m_pixelEnlargement * m_pixelSize;
123 PixelCoord LowPixelCoord (Coord coord)
const {
return Utils::LowSquare (m_pixelSize, coord); }
124 PixelCoord HighPixelCoord(Coord coord)
const {
return Utils::HighSquare(m_pixelSize, coord); }
127 Coord MinCoordOfPixel(PixelCoord pixelCoord)
const {
return Utils::MinCoord(m_pixelSize, pixelCoord); }
128 Coord MaxCoordOfPixel(PixelCoord pixelCoord)
const {
return Utils::MaxCoord(m_pixelSize, pixelCoord); }
131 void LowPixelPos (
const CoordPos& coordPos, PixelPos& pixelPos)
const {
return Utils::LowSquare (m_pixelSize, coordPos, pixelPos); }
132 void HighPixelPos(
const CoordPos& coordPos, PixelPos& pixelPos)
const {
return Utils::HighSquare(m_pixelSize, coordPos, pixelPos); }
135 void MinCoordPosOfPixel(
const PixelPos& pixelPos,
CoordPos& coordPos)
const { Utils::MinCoordPos(m_pixelSize, pixelPos, coordPos); }
136 void MaxCoordPosOfPixel(
const PixelPos& pixelPos,
CoordPos& coordPos)
const { Utils::MaxCoordPos(m_pixelSize, pixelPos, coordPos); }
141 void PixelPos_To_CellPos(
const PixelPos& pixelPos,
CellPos& cellPos)
const { Utils::BigSquarePos(m_nbPixelsOnCellSide, pixelPos, cellPos); }
145 void CoordBox_To_PixelBox(
const CoordBox& coordBox, PixelBox& pixelBox)
const { Utils::SquareBox(m_pixelSize, coordBox, pixelBox); }
146 void PixelBox_To_CoordBox(
const PixelBox& pixelBox,
CoordBox& coordBox)
const { Utils::GetCoordBox(m_pixelSize, pixelBox, coordBox); }
149 void CoordBox_To_CellBox(
const CoordBox& coordBox,
CellBox& cellBox)
const { Utils::SquareBox(m_cellSize, coordBox, cellBox); }
150 void CellBox_To_CoordBox(
const CellBox& cellBox,
CoordBox& coordBox)
const { Utils::GetCoordBox(m_cellSize, cellBox, coordBox); }
154 void PixelBox_To_CellBox(
const PixelBox& pixelBox,
CellBox& cellBox)
const { Utils::BigSquareBox(m_nbPixelsOnCellSide, pixelBox, cellBox); }
155 void CellBox_To_PixelBox(
const CellBox& cellBox, PixelBox& pixelBox)
const { Utils::SmallSquareBox(m_nbPixelsOnCellSide, cellBox, pixelBox); }
160 PixelCoord m_nbPixelsOnCellSide;
162 Coord m_coordEnlargement;
163 PixelCoord m_pixelEnlargement;
168 SwapEndianness(e,
self.m_pixelSize);
169 SwapEndianness(e,
self.m_cellSize);
170 SwapEndianness(e,
self.m_nbPixelsOnCellSide);
171 SwapEndianness(e,
self.m_coordEnlargement);
172 SwapEndianness(e,
self.m_pixelEnlargement);
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
Box2i CoordBox
A type that represents a bounding box in the integer 2D grid.
Definition: navmeshtypes.h:24
Vec2i CoordPos
A type that represents the position of a point within the 2D integer grid.
Definition: navmeshtypes.h:23
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36