TerrainPlanting

Description

sealed class Tinman.Engine.Components.TerrainPlanting

Derived from

PlantingOptions

Plants instanced geometry onto the terrain surface.

Public / Constructors

Terrain​Planting


public constructor TerrainPlanting → (1)

name opt : string = null

Initial value for Name.

Creates a new instance of TerrainPlanting.

Public / Methods

For


public method For → (5)

geometryId in : int32

See PlantingOptions.GeometryId.

model in : IModel

See Model.

offset opt : float32 = 0

See Offset.

scale opt : float32 = 1

See Scale.

normal opt : float32 = 1

See Normal.

returns → TerrainPlanting

this

Helper for setting planting options.

On


public method On → (3)

material in : int32

See PlantingOptions.Material.

weightFrom opt : int32 = 0

See PlantingOptions.Weight.

weightTo opt : int32 = 255

See PlantingOptions.Weight.

returns → TerrainPlanting

this

Helper for setting planting options.

Where


public method Where → (4)

distanceFrom in : float32

See PlantingOptions.Distance.

distanceTo in : float32

See PlantingOptions.Distance.

curvature opt : float32 = 1

See Curvature.

slope opt : float32 = 1

See Slope.

returns → TerrainPlanting

this

Helper for setting planting options.

With


public method With → (3)

density in : float32

See PlantingOptions.Density.

probability opt : float32 = 1

See PlantingOptions.Probability.

scatter opt : float32 = 1

See PlantingOptions.Scatter.

returns → TerrainPlanting

this

Helper for setting planting options.

Public / Attributes

Curvature


public attribute Curvature → (get,set)

value : float32

= 0 : Plant regardless of terrain curvature.
> 0 : Plant where terrain curvature is less than or equal to value.
< 0 : Plant where terrain curvature is greater than or equal to -value.

Clamps the allowed terrain curvature.

Defaults to 0.

Enabled


public attribute Enabled → (get,set)

value : bool

true if enabled, false if disabled.

Is this terrain planting options object enabled, i.e. geometry instances will be planted onto the terrain?

Defaults to true.

Model


public attribute Model → (get,set)

value : IModel

The 3D model or null.

The 3D model to plant onto the terrain.

Defaults to null.

Name


public attribute Name → (get,set)

value : string

The human-readable name or null if none.

Human-readable name of these terrain planting options.

Defaults to null.

Normal


public attribute Normal → (get,set)

value : float32

0 : The model Y+ axis is aligned with the terrain-space up-vector.
1 : The model Y+ axis is aligned with the terrain-space normal vector.

Blends between the terrain-space up- and normal vectors.

Defaults to 0.

Offset


public attribute Offset → (get,set)

value : float32

The vertical offset.

Vertical offset along instance normal (as defined by Normal).

Defaults to 0.

Scale


public attribute Scale → (get,set)

value : float32

The scale factor.

Scale factor to apply to model-space.

Defaults to 1.

Slope


public attribute Slope → (get,set)

value : float32

= 0 : Plant regardless of terrain slope.
> 0 : Plant where terrain slope is less than or equal to value.
< 0 : Plant where terrain slope is greater than or equal to -value.

Clamps the allowed terrain slope.

Defaults to 0.