Planting

Description

sealed class Tinman.Terrain.Meshing.Planting

The Planting class traverses the filtered mesh (see IMeshFilters.FilterIn) and plants geometry instances on mesh sectors.

The terrain mesh is traversed and locations for planting geometry instances are computed. This can be configured via PlantOptions. The generation of geometry instance data is performed by the IPlanter object (see Planter). For each call to IPlanter.InstancePlant, the planter computes zero or one instance data tuples, which are then cached by the VertexBufferCache object (see InstanceCache).

The following vertex data semantics are used by this class:

Public / Constructors

Planting


public constructor Planting → ()

Creates a new instance of Planting.

Public / Methods

Plant​Options


public method PlantOptions → (1)

options in : PlantingOptions

[not-null]
The planting options to use.

Takes a snapshot of the given planting options and uses them for subsequent planting.

To plant geometry with the given options, call one of these methods:

To generate batches for the planted geometry, call IBatchRendererBase.ComputeBatches.

Plant​Sector


public method PlantSector → (2)

sector in : int32

The mesh sector to plant on.

buffer in : MemoryDataStream

[not-null]
The buffer to use for writing instance data of planted geometry.

returns → PlantingChunk

The resulting planting chunk.

Plants geometry instances on the surface of the given terrain mesh sector, using the current settings.

The current IPlanter object is used (see Planter). The planting options are taken from the current PlantingOptions object (see PlantOptions). Instance data of planted geometry is written to the given buffer in, starting at its current position. Geometry instances are discarded silently if the buffer overflows at its current limit.

Calling PlantSector will not generate any PlantingBatch values.

Public / Attributes

Filter​In


public attribute FilterIn → (get,set)

value : MeshTreeFilter

The filter or null.

The mesh tree input filter to use for querying sector culling and marks.

The default value is null (i.e. all mesh sectors are visited).

Has​Delayed​Updates


public attribute HasDelayedUpdates → (get)

value : bool

true if one or more geometry chunk have not yet been updated because of UpdateDelay,
false if all geometry chunks are up-to-date.

Are there any delayed geometry chunk updates?

Instance​Cache


public attribute InstanceCache → (get,set)

value : VertexBufferCache

The instance cache.

The geometry instance cache to use.

Planter


public attribute Planter → (get,set)

value : IPlanter

The planter object.

The planter object to use.

Update​Delay


public attribute UpdateDelay → (get,set)

value : int32

[>=0]
The delay, in milliseconds.

Optional delay to wait before recomputing a geometry instance chunk for an updated terrain mesh sector.

Defaults to 0.