TerrainMesh
Description
- Derived from
-
Disposable abstract
Represents a terrain mesh.
The TerrainMesh class provides a high-level API that wraps the terrain features of the Tinman 3D SDK in an easy to use way:
-
Setup and configuration of the object graph that is necessary for terrain rendering.
-
Terrain layers for flexible management of rendering style and data sources.
-
Geo-referenced terrain decals.
-
Geo-referenced terrain 3D models.
-
Global dynamic planting of 3D models onto the terrain surface, using GPU instancing for rendering.
The layers of a terrain mesh are ordered by their sort index value (see TerrainLayer.SortIndex). Layers use alpha-blending, so layers with higher sort index values will occlude others. The implicit layer at sort index -0.5
is used to render the terrain materials:
+-------+ | Layer | SortIndex = -1000 (implicit layer for plain mesh with vertex colors) +-------+ | Layer | SortIndex = -999 (minimum allowed sort index) +-------+ | ... | +-------+ | Layer | SortIndex = -2 +-------+ | Layer | SortIndex = -1 +-------+ (Materials) SortIndex = -0.5 (implicit layer for materials) +-------+ | Layer | SortIndex = 0 +-------+ | Layer | SortIndex = +1 +-------+ | ... | +-------+ | Layer | SortIndex = +999 (maximum allowed sort index) +-------+
Public / Constructors
TerrainMesh
Creates a new instance of TerrainMesh.
Elevation values of the given mesh heightmap (see MeshOptions.Heightmap) are interpreted as relative offsets to the ellipsoid surface.
- ValidatingException
-
If the given options in are invalid.
- GeorefException
-
If MeshOptions.Geometry is
null
and the given geo-reference is not suitable.
Public / Methods
DecalAdd
Adds the given terrain decal.
If the given decal in is already present, the method silently returns.
DecalRemove
Removes the given terrain decal.
If the given decal in is not present, the method silently returns.
LayerGet
Returns an existing terrain layer.
The sequence of terrain layers is sorted by the layer sort index ( TerrainLayer.SortIndex), in ascending order.
LayerRemove
Removes an existing terrain layer.
If the given layer in is not of type TerrainLayerType.Texture or has not been created with LayerCreate, the method will return silently.
ModelAdd
Adds a terrain 3D model.
If the given model in is already present, the method silently returns.
ModelRemove
Removes a terrain 3D model.
If the given model in is not present, the method silently returns.
Public / Attributes
Geocentric
The Geocentric helper object of the terrain mesh.
The returned object is obtained from IGeometry.ToGeocentric and then augmented with the following data, if possible:
-
Gravity-related height offsets (see VerticalType.Gravity):
Using the IHeightmap object that has been specified in constructor call. -
Elevation model (see VerticalType.Ellipsoid):
Derived from MeshOptions.Heightmap, by extracting HeightmapLayer.Elevation via IHeightmapOps.Split.
Gravity
Optional heightmap that stores gravity-related offsets from the ellipsoid surface (see VerticalType.Gravity)
LayerFirst
Returns the visible terrain layer with the smallest sort index that occludes all other layers below it.