QtCraft API C++ classes QML types Handbook

QcSectionAddress Struct

A section of a chunk: the address a key of qcSectionKey() stands for, and the section a light or mesh change concerns (decision E-975). More...

Header: #include <common/core/QcSectionKey.h>

Public Variables

QcChunkPos chunk
int section
QcSectionAddress qcSectionFromKey(quint64 key)
quint64 qcSectionKey(QcChunkPos pos, int section)

Detailed Description

Member Variable Documentation

QcChunkPos QcSectionAddress::chunk

The chunk.

int QcSectionAddress::section

The section's index in the chunk.

Related Non-Members

[constexpr] QcSectionAddress qcSectionFromKey(quint64 key)

Returns the section address key stands for (the inverse of qcSectionKey()).

[constexpr] quint64 qcSectionKey(QcChunkPos pos, int section)

Returns the key of section section of the chunk at pos: packs the address into a single integer for render-side maps, 28 bits each for the chunk's x and z (two's complement; chunks reach ±QcWorld::maxHorizontalChunk, which needs 27, decision E-883), 8 bits for the section index.