24 _tileCount(outerWidth*outerWidth - holeWidth*holeWidth),
26 _holeWidth(holeWidth),
27 _outerWidth(outerWidth),
28 _ringWidth((outerWidth - holeWidth) / 2)
30 assert((outerWidth - holeWidth) % 2 == 0);
35 assert(x >= 0 && x < _outerWidth);
36 assert(y >= 0 && y < _outerWidth);
37 return x < _ringWidth || y < _ringWidth || x >= _outerWidth - _ringWidth || y >= _outerWidth - _ringWidth;
42 pAdj->neighbourPlusX = 1.0f;
43 pAdj->neighbourPlusY = 1.0f;
44 pAdj->neighbourMinusX = 1.0f;
45 pAdj->neighbourMinusY = 1.0f;
48 constexpr F32 innerNeighbourSize = 0.5f;
49 constexpr F32 outerNeighbourSize = 2.0f;
54 if (y >= _ringWidth && y < _outerWidth-_ringWidth)
56 if (x == _ringWidth-1)
58 pAdj->neighbourPlusX = innerNeighbourSize;
60 if (x == _outerWidth - _ringWidth)
62 pAdj->neighbourMinusX = innerNeighbourSize;
65 if (x >= _ringWidth && x < _outerWidth - _ringWidth)
67 if (y == _ringWidth-1)
69 pAdj->neighbourPlusY = innerNeighbourSize;
71 if (y == _outerWidth - _ringWidth)
73 pAdj->neighbourMinusY = innerNeighbourSize;
82 pAdj->neighbourMinusX = outerNeighbourSize;
86 pAdj->neighbourMinusY = outerNeighbourSize;
88 if (x == _outerWidth - 1)
90 pAdj->neighbourPlusX = outerNeighbourSize;
92 if (y == _outerWidth - 1)
94 pAdj->neighbourPlusY = outerNeighbourSize;
110 ret[index].data.positionX = tileSize() * (
to_F32(x) - halfWidth);
111 ret[index].data.positionZ = tileSize() * (
to_F32(y) - halfWidth);
112 ret[index].data.tileScale = tileSize();
113 ret[index].data.ringID =
to_F32(ringID);
119 assert(index == tileCount());
TileRing(I32 holeWidth, I32 outerWidth, F32 tileSize) noexcept
void AssignNeighbourSizes(I32 x, I32 y, Adjacency *) const noexcept
vector< InstanceData > createInstanceDataVB(I32 ringID)
bool InRing(I32 x, I32 y) const noexcept
Handle console commands that start with a forward slash.
constexpr F32 to_F32(const T value)
eastl::vector< Type > vector