Divooka Reference

Populations

2 nodes

On this page 2

Populate Terrain

Function

Places species over a terrain, each in turn: Poisson-disk spacing thinned by its density and mask, off slopes too steep for it and out of water, clear of the species placed before it. The same seed places the same things.

Signature
Populate -> Terrain Population
    terrain: Scalar Field
    species: Population Species Array
    analysis: Terrain Analysis Maps
    seed: Integer
    maxInstances: Integer
TerrainPopulation Populate(
    ScalarField2D terrain,
    PopulationSpecies[] species,
    TerrainAnalysisMaps analysis,
    int seed = 1337,
    int maxInstances = 400000)

Parameters

nametypedefaultdescription
terrainScalar Field—Heights in metres, with their metres per cell.
speciesPopulation Species Array—The species, the first placed first: trees before the rocks that keep out of their way.
analysisTerrain Analysis Maps—An erosion's maps and the water, which the species' masks read by name; nothing but a water species stands in the water.
seedInteger1337Where the random draws start.
maxInstancesInteger400000The most placed in all.

Returns

PopulationTerrain Population
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Populations
Package
Procedural Generation

Population Species

Function

One kind of thing to place, and the rules it is placed by.

Signature
Species -> Population Species
    model: Population Model
    spacingMetres: Number
    density: Number
    mask: Terrain Mask
    maxSlopeDegrees: Number
    minScale: Number
    maxScale: Number
    clearanceMetres: Number
    variants: Integer
    inWater: Truth
    name: Text
PopulationSpecies Species(
    PopulationModel model = PopulationModel.Pine,
    double spacingMetres = 6,
    double density = 1,
    TerrainMask mask,
    double maxSlopeDegrees = 35,
    double minScale = 0.8,
    double maxScale = 1.2,
    double clearanceMetres = 1.5,
    int variants = 4,
    bool inWater = false,
    string name = "")

Parameters

nametypedefaultdescription
modelPopulation ModelPineWhat it is drawn as.
spacingMetresNumber6The least distance between two of it, metres.
densityNumber1How full the room the spacing leaves is filled where the mask is full: 1 as close as the spacing allows.
maskTerrain Mask—Where it grows, from the terrain masks; everywhere when left out.
maxSlopeDegreesNumber35The steepest ground it stands on, degrees.
minScaleNumber0.8The smallest it is drawn, against the model's own size.
maxScaleNumber1.2The largest it is drawn.
clearanceMetresNumber1.5How far from each of these the species placed after it keep, metres.
variantsInteger4How many different shapes of the model are made.
inWaterTruthFalseWhether it may stand in water.
nameText—Its name.

Returns

SpeciesPopulation Species
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Populations
Package
Procedural Generation