QtCraft API C++ classes QML types Handbook

QcWorld Namespace

The dimensions of the world. More...

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

Variables

const int blocksPerSection
const int chunkSize
const int maxChunkBlock
const int seaLevel
const int sectionCount
const int sectionHeight
const double voidFloorY
const double voidLimitY
const int worldHeight

Functions

bool isInVoid(double y)

Detailed Description

One block is one cubic metre; all lengths here are in blocks (= metres).

Variable Documentation

const int QcWorld::blocksPerSection

Blocks in one section.

const int QcWorld::chunkSize

Width and depth of a chunk column.

const int QcWorld::maxChunkBlock

The farthest block column of the chunks within the bound: the positive edge chunk reaches chunkSize - 1 columns beyond maxHorizontalBlock. Saved positions up to here are valid.

const int QcWorld::seaLevel

The default height of the sea's surface (worldgen settings may set another).

const int QcWorld::sectionCount

Sections per chunk.

const int QcWorld::sectionHeight

Height of a section, the cube a chunk is stacked of.

const double QcWorld::voidFloorY

Bodies stop sinking here, far below the void limit: players die on the way (at most about 120 m below the limit) and everything else is removed, so it only holds a player in a world whose time stands still (/tick freeze) and keeps saved heights bounded.

const double QcWorld::voidLimitY

The void below the world bottom (decision E-288): nothing blocks a fall there, and from this height on players take void damage while everything else is removed.

const int QcWorld::worldHeight

Height of the world: blocks from y 0 up to worldHeight - 1.

Function Documentation

[constexpr] bool QcWorld::isInVoid(double y)

Returns whether the height y lies in the void (below voidLimitY).