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


public constructor Planting → ()

Creates a new instance of Planting.

Public / Methods


public method PlantOptions → (1)

options in : PlantingOptions

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.


public method PlantSector → (2)

sector in : int32

The mesh sector to plant on.

buffer in : MemoryDataStream

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


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).


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?


public attribute InstanceCache → (get,set)

value : VertexBufferCache

The instance cache.

The geometry instance cache to use.


public attribute Planter → (get,set)

value : IPlanter

The planter object.

The planter object to use.


public attribute UpdateDelay → (get,set)

value : int32

The delay, in milliseconds.

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

Defaults to 0.