Planting
Description
- Derived from
-
BatchContainerBase<PlantingBatch> abstract
ICameraInfoDependent
IBatchRendererBase
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:
-
required : Semantic.HeightmapCoords
-
required : Semantic.Normal
-
required : Semantic.Position
-
required : Semantic.Radius
-
required : Semantic.Version
-
optional : Semantic.Elevation
-
optional : Semantic.ElevationMinMax
-
optional : Semantic.Material
-
optional : Semantic.MaterialMask
-
optional : Semantic.MaterialRange
-
optional : Semantic.Texture
Public / Methods
PlantOptions
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:
-
PlantSector
Plants geometry on the given mesh sector. -
IMeshTraversal.VisitFaces
Traverses the whole mesh and calls PlantSector accordingly. -
IMeshTraversal.VisitSector
Traverses the whole sub-mesh starting at the given sector and calls PlantSector accordingly.
To generate batches for the planted geometry, call IBatchRendererBase.ComputeBatches.
PlantSector
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.
- See also