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

class Planting in Tinman.Terrain.Meshing

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

sealed class Planting implements IBatchContainer<PlantingBatch>
  ICameraInfoDependent
  extends MeshTraversal

Remarks

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 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 / Attributes

BatchCount

Returns the current number of rendering batches that are buffered by this object.

public property BatchCount { get }
type int32
value [>=0] The number of rendering batch elements.
implements IBatchContainerBase.BatchCount

See also:

IBatchContainer.GetBatch

CameraInfo

The object that provides the current camera position.

public property CameraInfo { get set }
type CameraInfo
value [not-null] The camera position provider.
implements ICameraInfoDependent.CameraInfo

FilterIn

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

public property FilterIn { get set }
type MeshTreeFilter
value The filter or null.
inherited MeshTraversal.FilterIn

Remarks:

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

See also:

MeshTree.GetRoot
MeshTree.GetChild
MeshTree.GetDown

FilterOut

The mesh tree output filter to use for performing sector culling and marking.

public property FilterOut { get set }
type MeshTreeFilter
value The mesh tree filter object.
inherited MeshTraversal.FilterOut

Remarks:

This MeshTreeFilter is not reset automatically. The application is responsible to call Reset.

The default value is null (i.e. the input filter is used in that case).

See also:

MeshTree.SectorCull
MeshTree.SectorMark
MeshTree.SectorMarkRoots

HasDelayedUpdates

Are there any delayed geometry chunk updates?

public property HasDelayedUpdates { get }
type bool
value true if one or more geometry chunk have not yet been updated because of UpdateDelay,
false if all geometry chunks are up-to-date.

HasMesh

Has this object been bound to an IMesh object?

public property HasMesh { get }
type bool
value true if this object is currently bound to an IMesh, false if not.
inherited MeshBoundBase.HasMesh

InstanceCache

The geometry instance cache to use.

public property InstanceCache { get set }
type VertexBufferCache
value The instance cache.

Mesh

The CLOD mesh this object is currently bound to.

public property Mesh { get }
type IMesh
value The CLOD mesh or null.
inherited MeshBoundBase.Mesh

Planter

The planter object to use.

public property Planter { get set }
type IPlanter
value The planter object.

Tree

The filtered MeshTree of this mesh traversal object.

public property Tree { get }
type MeshTree
value [not-null] The filtered MeshTree object or null if this object is not bound.
inherited MeshTraversal.Tree

UpdateDelay

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

public property UpdateDelay { get set }
type int32
value [>=0] The delay, in milliseconds.

Remarks:

Defaults to 0.

Public / Constructors

Planting

Creates a new instance of Planting.

public constructor Planting ()

Public / Methods

ClearBatches

Clears all planting batches.

public method ClearBatches ()

GetBatch

Returns the index-th rendering batch.

public method GetBatch (int32 index)
type PlantingBatch
params index [0..BatchCount-1] Index of rendering batch to return.
returns The rendering batch.
implements IBatchContainer.GetBatch

Remarks:

Usually, the sort order of batches is well-defined, in order to minimize state changes when processing batches first to last. Please refer to the documentation of the respective batch type for details.

MeshBind

Binds this object to the given IMesh.

public override method MeshBind (IMesh mesh)
params mesh The mesh object.
overrides MeshTraversal.MeshBind

MeshUnbind

Unbinds this object from its current IMesh.

public override method MeshUnbind ()
overrides MeshBoundBase.MeshUnbind

PlantChunk

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

public method PlantChunk (int32 sector, MemoryDataStream buffer)
type PlantingChunk
params sector The mesh sector to plant on.
  buffer [not-null] The buffer to use for writing instance data of planted geometry.
returns The resulting planting chunk.

Remarks:

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, starting at its current position. Geometry instances are discarded silently if the buffer overflows at its current limit.

Calling PlantChunk will not generate any PlantingBatch values.

See also:

Planter
PlantOptions

PlantMesh

Plants geometry instances on the terrain mesh and generates planting batches for each geometry chunk.

public method PlantMesh ()

PlantOptions

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

public method PlantOptions (PlantingOptions options)
params options [not-null] The planting options to use.

See also:

PlantMesh
PlantChunk

VisitFaces

Visits the given mesh root sectors.

public method VisitFaces (CubemapFace meshFace = CubemapFace.All)
params meshFace The mesh face to traverse. Defaults to All.
inherited MeshTraversal.VisitFaces

VisitQuadrant

Visits a quadrant of the given mesh sector on the current face, assuming that the corresponding child mesh sector does not exist.

public override method VisitQuadrant (int32 sector, int32 childIdx)
params sector Index of center vertex of sector to visit.
  childIdx Index of non-existing child sector in sector.
implements MeshTraversal.VisitQuadrant

Remarks:

The quadtree data structure for visiting the given sector can be obtained by getting the Tree property of the current mesh (see MeshBind.

VisitSector

Visits the given mesh sector on the current face.

public override method VisitSector (int32 sector)
params sector Index of center vertex of sector to visit.
implements MeshTraversal.VisitSector

Remarks:

The quadtree data structure for visiting the given sector can be obtained by getting the Tree property of the current mesh (see MeshBind.