![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
Hexagonal cells. More...
#include <gf/Cells.h>
Public Member Functions | |
HexagonalCells (Vector2f tileSize, float sideLength, CellAxis axis, CellIndex index) | |
Make hexagonal cells of the specified size. More... | |
HexagonalCells (float radius, CellAxis axis, CellIndex index) | |
Make hexagonal cells of the specified size. More... | |
RectF | computeBounds (Vector2i layerSize) const noexcept override |
Compute the local bounds of the cells. More... | |
RectI | computeVisibleArea (const RectF &local) const noexcept override |
Compute the visible area in terms of coordinates. More... | |
RectF | computeCellBounds (Vector2i coords) const noexcept override |
Compute the cell bounds. More... | |
Vector2i | computeCoordinates (Vector2f position) const noexcept override |
Compute the coordinates of a cell. More... | |
Polyline | computePolyline (Vector2i coords) const override |
Compute the polyline representing a cell. More... | |
std::vector< Vector2i > | computeNeighbors (Vector2i coords, Vector2i layerSize, Flags< CellNeighborQuery > flags=gf::None) const override |
Compute the neighbors of a cell. More... | |
![]() | |
virtual | ~Cells () |
Virtual destructor. More... | |
virtual RectF | computeBounds (Vector2i layerSize) const noexcept=0 |
Compute the local bounds of the cells. More... | |
virtual RectI | computeVisibleArea (const RectF &local) const noexcept=0 |
Compute the visible area in terms of coordinates. More... | |
virtual RectF | computeCellBounds (Vector2i coords) const noexcept=0 |
Compute the cell bounds. More... | |
virtual Vector2i | computeCoordinates (Vector2f position) const noexcept=0 |
Compute the coordinates of a cell. More... | |
virtual Polyline | computePolyline (Vector2i coords) const =0 |
Compute the polyline representing a cell. More... | |
virtual std::vector< Vector2i > | computeNeighbors (Vector2i coords, Vector2i layerSize, Flags< CellNeighborQuery > flags=gf::None) const =0 |
Compute the neighbors of a cell. More... | |
Static Public Member Functions | |
static Vector2f | computeRegularSize (CellAxis axis, float radius) |
Get the size of a regular hexagon. More... | |
Hexagonal cells.
|
inline |
Make hexagonal cells of the specified size.
tileSize | The size of a cell |
sideLength | The length of the side |
axis | The cells axis |
index | The cells index |
Make hexagonal cells of the specified size.
radius | The radius of the regular hexagon |
axis | The cells axis |
index | The cells index |
Compute the local bounds of the cells.
layerSize | The size of the layer |
Implements gf::Cells.
Compute the cell bounds.
coords | The coordinates of the cell |
Implements gf::Cells.
Compute the coordinates of a cell.
position | The local position |
Implements gf::Cells.
|
overridevirtual |
Compute the neighbors of a cell.
coords | The coordinates of the cell |
layerSize | The size of the layer |
flags | The parameters of the query |
Implements gf::Cells.
Compute the polyline representing a cell.
coords | The coordinates of the cell |
Implements gf::Cells.
Get the size of a regular hexagon.
axis | The hexagon axis |
radius | Radius of hexagon |