TerrainRoadLayer Class |
Namespace: DigitalRune.Graphics
The TerrainRoadLayer type exposes the following members.
Name | Description | |
---|---|---|
TerrainRoadLayer |
Initializes a new instance of the TerrainRoadLayer class with the default
material.
|
Name | Description | |
---|---|---|
ClampRoadToTerrain |
Clamps a road path to the terrain height.
| |
ClampTerrainToRoad |
Clamps the terrain height to the road ("carves the road into the terrain").
| |
CreateMesh |
Creates a road mesh for use with a TerrainRoadLayer.
| |
Dispose |
Releases all resources used by an instance of the TerrainLayer class.
(Inherited from TerrainLayer.) | |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the TerrainLayer class
and optionally releases the managed resources.
(Overrides TerrainLayerDispose(Boolean).) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
SetMesh |
Sets the road mesh and related properties.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Aabb |
Gets (or sets) the axis-aligned bounding box of the area that is influenced by this terrain
layer.
(Inherited from TerrainLayer.) | |
Alpha |
Gets or sets the opacity (alpha). (This is a material parameter - see remarks.)
| |
BorderBlendRange |
Gets or sets a value which determines how the sides of the road mesh fade out.
(This is a material parameter - see remarks.)
| |
DiffuseColor |
Gets or sets the diffuse color. (This is a material parameter - see remarks.)
| |
DiffuseTexture |
Gets or sets the diffuse texture. (This is a material parameter - see remarks.)
| |
FadeInEnd |
Gets or sets the clipmap level where the fade-in ends and this terrain layer is fully
visible. (This is a material parameter - see remarks.)
(Inherited from TerrainLayer.) | |
FadeInStart |
Gets or sets the clipmap level where this terrain layer starts to fade in.
(This is a material parameter - see remarks.)
(Inherited from TerrainLayer.) | |
FadeOutEnd |
Gets or sets the clipmap level where the fade-out ends and this terrain layer is not
rendered anymore. (This is a material parameter - see remarks.)
(Inherited from TerrainLayer.) | |
FadeOutStart |
Gets or sets the clipmap level where this terrain layer starts to fade out.
(This is a material parameter - see remarks.)
(Inherited from TerrainLayer.) | |
HeightTexture |
Gets or sets the height texture. (This is a material parameter - see remarks.)
| |
HeightTextureBias |
Gets or sets the bias that is added to samples of the height texture.
(This is a material parameter - see remarks.)
| |
HeightTextureScale |
Gets or sets the scale that is multiplied with samples of the height texture.
(This is a material parameter - see remarks.)
| |
IsDisposed |
Gets a value indicating whether this instance has been disposed of.
(Inherited from TerrainLayer.) | |
Material |
Gets (or sets) the material that is used to render this terrain layer.
(Inherited from TerrainLayer.) | |
MaterialInstance |
Gets the material instance.
(Inherited from TerrainLayer.) | |
NormalTexture |
Gets or sets the normal texture. (This is a material parameter - see remarks.)
| |
RoadLength |
Gets the length of the road in world space units.
(This is a material parameter - see remarks.)
| |
SpecularColor |
Gets or sets the specular color. (This is a material parameter - see remarks.)
| |
SpecularPower |
Gets or sets the specular color exponent. (This is a material parameter - see remarks.)
| |
SpecularTexture |
Gets or sets the specular texture. (This is a material parameter - see remarks.)
| |
Submesh |
Gets the mesh that represents the road.
| |
TileSize |
Gets or sets the tile size of the road textures in world space.
(This is a material parameter - see remarks.)
|
The TerrainRoadLayer renders a mesh which represents a road (or other road-like structures, e.g. skid marks). The road is represented by a Submesh which can be set using SetMesh(Submesh, Aabb, Single, Boolean).
Material textures DiffuseTexture, SpecularTexture, NormalTexture and HeightTexture are rendered along the road. The u-axis of the texture is mapped to the width of the road; the v-axis is mapped to the direction of the road. The textures are repeated along the road direction. The property determines the scale of tiling. (Textures are not tiled along the u-axis.)
The helper methods CreateMesh(GraphicsDevice, Path3F, Single, Int32, Single, Submesh, Aabb, Single), ClampRoadToTerrain(Path3F, HeightField) and ClampTerrainToRoad(HeightField, Path3F, Single, Single, Int32, Single) can be used to create a road mesh and to clamp a road mesh to a terrain or to carve a road into a terrain.
Important: The terrain road layer is only rendered on tiles where the layer is added. If the road stretches over multiple tiles, it needs to be added to all tiles. (An instance of TerrainRoadLayer can be shared by multiple terrain tiles.)