TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class TerrainPlanting in Tinman.AddOns.Components

sealed class TerrainPlanting extends PlantingOptions

Public / Attributes

CanPlant

Is this PlantingOptions ready for being used for planting?

public override property CanPlant { get }
type bool
value true if this planting options object is ready, false if not.
overrides PlantingOptions.CanPlant

Curvature

Clamps the allowed terrain curvature.

public property Curvature { get set }
type float32
value = 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.

Remarks:

Defaults to 0.

See also:

IPlanter.InstancePlant

Density

Determines the overall density of planted geometry instances.

public property Density { get set }
type float32
value [>=0] The density, in terrain-space. If 0, planting is disabled.
inherited PlantingOptions.Density

Remarks:

The density value is interpreted as the average distance between geometry instances.

The default value is 1.

Distance

Limits the minimum and maximum distance from the camera to the planting location.

public property Distance { get set }
type RangeF
value The distance range, in terrain-space.
inherited PlantingOptions.Distance

Remarks:

Geometry instances will not be planted outside of this distance range.

The distance range is used in conjunction with Radius in order to improve the performance of PlantMesh.

The default value is Zero.

Elevation

Constraints planting to the given terrain-space elevation range.

public property Elevation { get set }
type RangeF
value The distance range, in terrain-space.
inherited PlantingOptions.Elevation

Remarks:

Geometry instances will not be planted outside of this elevation range.

The elevation range is used in conjunction with ElevationMinMax in order to improve the performance of PlantMesh.

The default value is Max.

Enabled

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

public property Enabled { get set }
type bool
value true if enabled, false if disabled.

Remarks:

Defaults to true.

GeometryId

The geometry ID of the planted geometry instances.

public property GeometryId { get set }
type int32
value The geometry ID.
inherited PlantingOptions.GeometryId

Remarks:

The geometry ID is forwarded to InstancePlant.

The default value is 0.

Material

The surface material to plant geometry instances on.

public property Material { get set }
type int32
value [-1..255] The material ID (see MaterialToken). Use -1 to plant everywhere, regardless of materials.
inherited PlantingOptions.Material

Remarks:

If the Material vertex array is not present, planting will be performed everywhere. If present, the MaterialMask vertex array is used to improve performance, by culling mesh sectors that do not contain any relevant materials.

The material ID is used in conjunction with MaterialMask in order to improve the performance of PlantMesh.

The default value is -1.

Model

The 3D model to plant onto the terrain.

public property Model { get set }
type IModel
value The 3D model or null.

Remarks:

Defaults to null.

Name

Human-readable name of these terrain planting options.

public property Name { get set }
type string
value The human-readable name or null if none.

Remarks:

Defaults to null.

Normal

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

public property Normal { get set }
type float32
value 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.

Remarks:

Defaults to 0.

Offset

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

public property Offset { get set }
type float32
value The vertical offset.

Remarks:

Defaults to 0.

Probability

The probability for planting geometry instances.

public property Probability { get set }
type float32
value [0..1] The probability.
inherited PlantingOptions.Probability

Remarks:

The probability is applied after a location on the terrain for planting has been chosen (i.e. according to Density).

The default value is 1.

Scale

Scale factor to apply to model-space.

public property Scale { get set }
type float32
value The scale factor.

Remarks:

Defaults to 1.

Scatter

The scatter amount to apply when planting geometry instances.

public property Scatter { get set }
type float32
value [0..1] The scatter amount.
inherited PlantingOptions.Scatter

Remarks:

The default value is 1.

Slope

Clamps the allowed terrain slope.

public property Slope { get set }
type float32
value = 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.

Remarks:

Defaults to 0.

See also:

IPlanter.InstancePlant

Weight

The material weight range to use for planting.

public property Weight { get set }
type RangeI
value The material weight range (see MaterialToken).
inherited PlantingOptions.Weight

Remarks:

Geometry instances will not be planted if the material weight is outside of this range.

The material weight is used in conjunction with MaterialRange in order to improve the performance of PlantMesh.

The default value is [0..255].

Public / Constructors

TerrainPlanting

Creates a new instance of TerrainPlanting.

public constructor TerrainPlanting (string name = null)
params name Initial value for Name.

Public / Methods

Check

public method Check (float32 distance, float32 radius, int64 material)
type bool
params distance
  radius
  material
inherited PlantingOptions.Check

For

public method For (int32 geometryId, IModel model, float32 offset = 0, float32 scale = 1, float32 normal = 1)
type TerrainPlanting
params geometryId
  model
  offset
  scale
  normal

On

public method On (int32 material, int32 weightFrom = 0, int32 weightTo = 255)
type TerrainPlanting
params material
  weightFrom
  weightTo

Where

public method Where (float32 distanceFrom, float32 distanceTo, float32 curvature = 1, float32 slope = 1)
type TerrainPlanting
params distanceFrom
  distanceTo
  curvature
  slope

With

public method With (float32 density, float32 probability = 1, float32 scatter = 1)
type TerrainPlanting
params density
  probability
  scatter