QtCraft API C++ classes QML types Handbook

QcDeltaSites Class

Where the river deltas lie (decision E-850): from a point on a river, down the river to where it meets the coast (its mouth) and up the river to the apex of the fan, and whether that mouth gets a delta at all (a wide river through flat land straight into the open sea, and the chance). More...

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

Public Types

struct Site
Land

Public Functions

QcDeltaSites(quint64 seed, const QcRiverField &rivers, double share)
std::shared_ptr<const QcDeltaSites::Site> siteNear(double x, double z, const QcDeltaSites::Land &land) const

Static Public Members

const double coastContinent
const double fanLength
const double siteCell
const int traitCount

Detailed Description

Every column of a delta reaches the same mouth, so a delta is decided and shaped alike for all of them. Deterministic per seed and thread-safe; the sites are remembered per thread by cells of a few blocks along the rivers.

Member Type Documentation

[alias] QcDeltaSites::Land

The terrain's maps a delta reads (QcTerrainGenerator).

Member Function Documentation

QcDeltaSites::QcDeltaSites(quint64 seed, const QcRiverField &rivers, double share)

Seeds the delta chance from seed. rivers must outlive the sites (the terrain generator owns both); share: the share of the wide river mouths that get a delta (0..1; 1 every one).

std::shared_ptr<const QcDeltaSites::Site> QcDeltaSites::siteNear(double x, double z, const QcDeltaSites::Land &land) const

Returns the delta of the river near (x, z) on land (found from the middle of its cell of 8 blocks, or else from a cell around it), null for none; shared with the thread's memory of the sites (a site is too large to copy per column).

Member Variable Documentation

const double QcDeltaSites::coastContinent

The continent value of the coast where a delta's river meets the sea.

const double QcDeltaSites::fanLength

A fan reaches this many blocks up the river from the mouth.

const double QcDeltaSites::siteCell

The sites are searched from the middle of cells of this many blocks: every column of a cell has the same site.

const int QcDeltaSites::traitCount

The number of random traits of a delta (Site::traits).