QtCraft API C++ classes QML types Handbook

QcLightCells Namespace

Coordinates of the cells of the light engine (QcLightEngine): the chunk and the place in it of a block coordinate, the index of a cell column in a chunk, the faces that lead to the neighbour columns. More...

Header: #include <common/light/QcLightCells.h>

Variables

const std::array<QcBlockFace, 1 + sizeof...(_Args)> horizontalFaces

Functions

int columnIndex(int lx, int lz)
int floorChunk(int block)
int localOf(int block)

Detailed Description

Variable Documentation

const std::array<QcBlockFace, 1 + sizeof...(_Args)> QcLightCells::horizontalFaces

The four faces that lead to the neighbour columns.

Function Documentation

[constexpr] int QcLightCells::columnIndex(int lx, int lz)

Returns the index of the cell column (lx, lz) in its chunk: lz * chunkSize + lx.

[constexpr] int QcLightCells::floorChunk(int block)

Returns the chunk coordinate of the block coordinate block (rounding down for negative blocks).

[constexpr] int QcLightCells::localOf(int block)

Returns the place of the block coordinate block in its chunk, 0 to chunkSize - 1.