QtCraft API C++ classes QML types Handbook

QcTerrainSurface Class

The ground blocks of a terrain column from its ground biome (decision E-858): the surface block (under water the bed with its patches, river banks, the land of deltas, beaches, snow above the snow line, rock on steep slopes) and the soil below it. More...

Header: #include <worldgen/terrain/QcTerrainSurface.h>

Public Functions

QcTerrainSurface(const QcTerrainDefinitions &definitions, const QcRiverField &rivers, quint64 seed)
QcBlockId subsurface(const QcTerrainColumn &column, QcBlockId surface) const
QcBlockId surface(const QcTerrainColumn &column, int x, int z) const

Detailed Description

Deterministic per seed and thread-safe.

Member Function Documentation

QcTerrainSurface::QcTerrainSurface(const QcTerrainDefinitions &definitions, const QcRiverField &rivers, quint64 seed)

Reads the biomes from definitions and the patches of beds and banks from rivers; seed jitters the snow line. Both references must outlive the surface (the terrain generator owns all three).

QcBlockId QcTerrainSurface::subsurface(const QcTerrainColumn &column, QcBlockId surface) const

Returns the block of column below its surface block down to the subsurface depth: surface itself under water, on beaches, river banks and steep rock, else the biome's subsurface.

QcBlockId QcTerrainSurface::surface(const QcTerrainColumn &column, int x, int z) const

Returns the top block of column at x, z (its slope set where the biome has steep rock).