QtCraft API C++ classes QML types Handbook

QcVegetationPatchPlacer Class

Patches of one plant kind out of a biome's vegetation layer (decision E-814), as the reference's flower patches: each cell of QcVegetationPatches::patchCell blocks (aligned with the chunks) holds a patch per layer with the chance of the biome at a random centre in it; the patch tries tries columns around its centre, at most radius blocks away on each axis (more of them near the centre), and plants its one kind, chosen by weight, on every free column of that biome where the plant may stand. More...

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

Public Types

struct Patch
ColumnFilter

Public Functions

QList<QcVegetationPatchPlacer::Patch> patchesNear(QcChunkPos pos) const
void place(QcChunk &chunk, const QcTerrainColumnGrid &columns, const QList<bool> &carved, const QcVegetationPatchPlacer::ColumnFilter &allowed) const

Detailed Description

Deterministic per seed; thread-safe (only reads).

Member Type Documentation

[alias] QcVegetationPatchPlacer::ColumnFilter

Whether a column may get plants at all (not in a village or under a structure).

Member Function Documentation

QList<QcVegetationPatchPlacer::Patch> QcVegetationPatchPlacer::patchesNear(QcChunkPos pos) const

Returns the patches whose columns may reach into the chunk at pos.

void QcVegetationPatchPlacer::place(QcChunk &chunk, const QcTerrainColumnGrid &columns, const QList<bool> &carved, const QcVegetationPatchPlacer::ColumnFilter &allowed) const

Plants the patches into chunk (after the features: only into air), on the terrain columns of dry land of each patch's biome. carved: per column of the chunk (z * chunkSize + x), whether caves removed its top block; allowed filters the columns.