TerrainModel
Description
- Derived from
Describes a 3D model that is placed somewhere onto the terrain.
The coordinate system of a terrain model (in terms of ISpatialQuery) is terrain-space. For planetary terrains, this is the geocentric frame (see Geocentric). Analogously, the spatial bounds returned by ISpatialBounds are also in terrain-space.
When using a ISpatialCallback with the ISpatialQuery interface, the child indices provided by ISpatialCallback.ChildPush correlate with IModel.ChildAt for Model.
Geometry instancing can be used to render the 3D model multiple times on the GPU, without additional overhead on the CPU. The following mechanisms are provided by this class:
-
InstanceNone
Disables model instancing. -
InstanceStatic
Uses a static buffer of model instances. -
InstanceDynamic
Uses a dynamic buffer of model instances.
Public / Constructors
TerrainModel
5 overloads
Creates a new instance of TerrainModel.
Creates a new instance of TerrainModel.
Creates a new instance of TerrainModel.
Creates a new instance of TerrainModel.
Creates a new instance of TerrainModel.
Public / Methods
DecorationDirty
Invalidates the current 3D model decoration, if any.
This method must be called in the following situations:
Setting different model, pose or decorator objects automatically invalidates the model decoration. In these cases, this method does not need to be called.
- See also
DecorationUpdate
Applies the current 3D model decorator.
This method may be called repeatedly. If necessary, it will rebuild the model decoration (which may take some time) or update the existing model decoration (which usually completes quickly). If there is no work to do, the method returns instantly.
InstanceUpdate
Updates the next model instance.
This method may only be called between calls to InstanceUpdateBegin and InstanceUpdateEnd. Alternatively, model instance data (see ModelInstance.WriteInstance) may also be written directly to the model instance buffer (see InstanceUpdateBuffer).
Public / Attributes
Decoration
Returns the current 3D model decoration, building / updating it if necessary.
Building a new decoration may incur additional computational overhead, whereas updating it usually completes quickly. The DecorationUpdate method may be used to perform the building work eagerly, instead of lazily via this property.
Decorator
The decorator to use for building the decoration for non-instanced 3D models.
Defaults to null
.
InstanceRange
The range of model instances to render.
The instance range is clamped to the valid range of instance indices. Defaults to RangeI.Zero.
InstanceUpdater
The IInstanceUpdater that is used for this terrain model.
When an instance updater is present and InstanceCount is greater than zero, the TerrainView will call IInstanceUpdater.UpdateTerrainModelInstances from within IRenderable.Render automatically. Defaults to null
.
- See also
ModelBounds
Returns the ISpatialBounds of Model which takes Pose into account, if present.
- See also
ModelCollider
Returns the IModelCollider of Model which takes Pose into account, if present.
- See also
Transform
The transformation from model-space (in terrain units) to terrain-space (in terrain units), not taking into account the model pose.
Defaults to AffineTransform.Identity.