QtCraft API C++ classes QML types Handbook

QcTreeLayout Class

The blocks of one tree while QcTreeShape builds it: passes them on, and for trees with vines remembers what the tree occupies and which of its blocks vines may hang on, so vines go only to free sides. More...

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

Public Types

struct Corners

Public Functions

void buildGiantCone(const QcTreeShape::Params &params, QcBlockPos base, int trunkHeight, quint64 seed)
void buildGiantRound(const QcTreeShape::Params &params, QcBlockPos base, int trunkHeight, quint64 seed)
void hangVines(const QcTreeShape::Params &params, quint64 seed) const
void leaf(QcBlockPos pos, QcBlockId block, bool holdsVines)
void log(QcBlockPos pos, QcBlockId block, bool holdsVines)
void squareLayer(QcBlockPos centre, int radius, QcBlockId leaves, QcTreeLayout::Corners corners)

Static Public Members

const int giantCrownRadius

Detailed Description

Holds the giant crowns on a 2×2 trunk (decision E-822).

Member Function Documentation

void QcTreeLayout::buildGiantCone(const QcTreeShape::Params &params, QcBlockPos base, int trunkHeight, quint64 seed)

Builds the crown of a tall spruce with params on the 2×2 trunk at base of trunkHeight blocks: layered rings over most of the trunk, widest at the bottom, ragged by seed.

void QcTreeLayout::buildGiantRound(const QcTreeShape::Params &params, QcBlockPos base, int trunkHeight, quint64 seed)

Builds the branches and crown of a jungle giant with params on the 2×2 trunk at base of trunkHeight blocks: short branches with leaves along the upper trunk and a wide flat crown, placed by seed.

void QcTreeLayout::hangVines(const QcTreeShape::Params &params, quint64 seed) const

Hangs the vines of params on free sides of the blocks that hold them, by chance from seed; nothing for trees without vines.

void QcTreeLayout::leaf(QcBlockPos pos, QcBlockId block, bool holdsVines)

Places the leaves block at pos, only where QcTreeShape::mayReplace() allows; holdsVines lets vines hang on its free sides, and vines hang only on leaves that were placed.

void QcTreeLayout::log(QcBlockPos pos, QcBlockId block, bool holdsVines)

Places block at pos as a trunk or branch block; holdsVines lets vines hang on its free sides.

void QcTreeLayout::squareLayer(QcBlockPos centre, int radius, QcBlockId leaves, QcTreeLayout::Corners corners)

Places a square layer of leaves radius blocks around centre, its corners thinned as corners says.

Member Variable Documentation

const int QcTreeLayout::giantCrownRadius

Giant crowns reach this far beyond their 2×2 trunk, no further than leaves stay without a log (QcPlantManager::leafReach).