ITerrainTransform
Description
- Derived from
- Extended by
-
IdentityTransform sealed
SimpleTransform sealed
TerrainTransform abstract
Base interface for classes that represent a transformation between terrain-space and model-space.
Iff an implementation depends on the terrain mesh of the scene for its computations, the NeedsMesh property will return true
. If the return value is known at compile-time, the documentation will state that fact. The built-in scene entities and views handle mesh binding automatically (usually via mechanisms 4, 5 and 6 - see below). To bind a transform to a mesh in custom code, the following mechanisms can be used:
-
Call IMeshBound.MeshBind, passing TerrainMesh.Mesh of IScene.Terrain of IScene.
-
Call SceneObject.MeshAttach from the aggregating SceneObject class.
-
Call SceneEntity.MeshBoundAdd from the aggregating SceneEntity class.
-
Call SceneObject.ChildBinding1 from the aggregating SceneObject class.
-
Call SceneObject.ChildBinding2 from the aggregating property of a SceneObject class.
-
Set the ILocalSpaceProperty.LocalSpace property of an aggregating object.
A transform should be detached from the terrain mesh by calling IMeshBound.MeshUnbind when it is no longer being used, unless it is about to be deleted. The bind/unbind calls must be balanced and may be nested, as long as the passed IMesh object is the same. This allows sharing of ITerrainTransform objects by multiple objects in a scene. For mechanisms 2 and 3, using the paired method (i.e. SceneObject.MeshDetach and SceneEntity.MeshBoundRemove) will handle mesh binding. For the other mechanisms, mesh binding is handled automatically.
Public / Methods
Append
Appends the given transform to this one.
The concatenated transforms are applied as follows:
-
V' = other.ToTerrain * this.ToTerrain * V
-
V = this.ToModel * other.ToModel * V'
where V
is a point in model-space and V'
is a point in terrain-space.
Public / Attributes
NeedsMesh
Does this ITerrainTransform require a bound IMesh object?
If this property is false
, the Transform property will yield correct results, even if IMeshBound.HasMesh is false
.
If this property is true
, the Transform property will yield incorrect results when IMeshBound.HasMesh is false
.
Transform
Returns the affine transformation from model-space to terrain-space, (re-)computing it if necessary.
It is not necessary to call Compute before getting this property.