Click or drag to resize
DigitalRuneTerrain Class
Represents a height field based terrain. (Not available on these platforms: Xbox 360, mobile platforms)
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsTerrain

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class Terrain : IDisposable

The Terrain type exposes the following members.

Constructors
  NameDescription
Public methodTerrain
Initializes a new instance of the Terrain class.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by an instance of the Terrain class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the Terrain class and optionally releases the managed resources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInvalidate
Invalidates all data cached by the renderer.
Public methodInvalidate(Aabb)
Invalidates the specified region in the data cached by the renderer.
Public methodInvalidate(TerrainLayer)
Invalidates the specified terrain layer in the data cached by the renderer.
Public methodInvalidate(TerrainTile)
Invalidates the specified terrain tile in the data cached by the renderer.
Public methodInvalidate(TerrainTile, TerrainLayer)
Invalidates the specified terrain layer in the data cached by the renderer.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyAabb
Gets the axis-aligned bounding box of the terrain tile. (Vertical min and max values are not set!)
Public propertyBaseClearValues
Gets or sets the values written into the BaseClipmap textures when it is cleared.
Public propertyDetailClearValues
Gets or sets the values written into the DetailClipmap textures when it is cleared.
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed of.
Public propertyTiles
Gets the terrain tiles which define the terrain geometry and materials.
Top
Remarks

This type is not available on the following platforms: Xbox 360, mobile platforms

A terrain is split into one or more tiles. The terrain tiles defines the geometry (height, normals, holes) of the terrain. Each tile has a set of material layers (dirt, grass, decals, roads) that define the appearance. The material layers are applied (blended) one after the other, which means that a layer can override previous layers.

See TerrainTile and TerrainLayer for more information.

Cache invalidation:
When the Terrain is used with the TerrainNode, then the terrain data is cached in clipmaps. Therefore, it is important to notify the terrain system when a tile or layer has changed and the cached data is invalid. When tiles or layers are added to or removed from the terrain, this happens automatically. But when the properties or the contents of tiles/layers are changed, the affected region needs to be invalidated explicitly by calling the appropriate Invalidate method of the Terrain or the TerrainTile. For example, when the contents of a height map is changed, the affected region on the terrain needs to be invalidated by calling Invalidate(Aabb) or Invalidate(TerrainTile).

See Also