Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
MeshGrid Struct Reference

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
 

Detailed Description

Describes a grid with given step, oirginating at (0,0,0)

Member Function Documentation

◆ getCellPos() [1/2]

s16 MeshGrid::getCellPos ( s16  p) const
inline

returns coordinate of mesh cell given coordinate of a map block

References cell_size, and p().

Referenced by getCellPos(), getMeshPos(), and ClientMap::updateDrawList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCellPos() [2/2]

v3s16 MeshGrid::getCellPos ( v3s16  block_pos) const
inline

returns position of mesh cell in the grid given position of a map block

References getCellPos().

+ Here is the call graph for this function:

◆ getCellVolume()

u32 MeshGrid::getCellVolume ( ) const
inline

References cell_size.

◆ getMeshPos() [1/2]

s16 MeshGrid::getMeshPos ( s16  p) const
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMeshPos() [2/2]

v3s16 MeshGrid::getMeshPos ( v3s16  p) const
inline

Returns coordinates of the origin of the grid cell containing p.

References getMeshPos(), and p().

+ Here is the call graph for this function:

◆ getOffsetIndex()

u16 MeshGrid::getOffsetIndex ( v3s16  offset) const
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().

+ Here is the caller graph for this function:

◆ isMeshPos()

bool MeshGrid::isMeshPos ( v3s16 p) const
inline

Returns true if p is an origin of a cell in the grid.

References cell_size, and p().

+ Here is the call graph for this function:

Member Data Documentation

◆ cell_size


The documentation for this struct was generated from the following file: