Describes a grid with given step, oirginating at (0,0,0) More...
#include <numeric.h>
Public Member Functions | |
u32 | getCellVolume () const |
s16 | getCellPos (s16 p) const |
returns coordinate of mesh cell given coordinate of a map block | |
v3s16 | getCellPos (v3s16 block_pos) const |
returns position of mesh cell in the grid given position of a map block | |
s16 | getMeshPos (s16 p) const |
returns closest step of the grid smaller than p | |
v3s16 | getMeshPos (v3s16 p) const |
Returns coordinates of the origin of the grid cell containing p. | |
bool | isMeshPos (v3s16 &p) const |
Returns true if p is an origin of a cell in the grid. | |
u16 | getOffsetIndex (v3s16 offset) const |
Returns index of the given offset in a grid cell All offset coordinates must be smaller than the size of the cell. | |
Public Attributes | |
u16 | cell_size |
Describes a grid with given step, oirginating at (0,0,0)
|
inline |
returns coordinate of mesh cell given coordinate of a map block
References cell_size, and p().
Referenced by getCellPos(), getMeshPos(), and ClientMap::updateDrawList().
returns position of mesh cell in the grid given position of a map block
References getCellPos().
|
inline |
References cell_size.
|
inline |
returns closest step of the grid smaller than p
References cell_size, getCellPos(), and p().
Referenced by MeshUpdateQueue::addBlock(), getMeshPos(), ClientMap::renderMap(), ClientMap::renderMapShadows(), and ClientMap::updateDrawList().
Returns coordinates of the origin of the grid cell containing p.
References getMeshPos(), and p().
|
inline |
Returns index of the given offset in a grid cell All offset coordinates must be smaller than the size of the cell.
References cell_size.
Referenced by Client::step().
|
inline |
u16 MeshGrid::cell_size |