Click or drag to resize
DigitalRuneTerrainRoadLayerClampTerrainToRoad Method
Clamps the terrain height to the road ("carves the road into the terrain").

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public static void ClampTerrainToRoad(
	HeightField terrain,
	Path3F road,
	float defaultWidth,
	float defaultSideFalloff,
	int maxNumberOfIterations,
	float tolerance
)

Parameters

terrain
Type: DigitalRune.Geometry.ShapesHeightField
The terrain represented by a HeightField.
road
Type: DigitalRune.Mathematics.InterpolationPath3F
The path that represents the road.
defaultWidth
Type: SystemSingle
The default road width.
defaultSideFalloff
Type: SystemSingle
The default side falloff.
maxNumberOfIterations
Type: SystemInt32
The maximum number of iterations (used when tessellating the path).
tolerance
Type: SystemSingle
The tolerance in world space units (used when tessellating the path).
Exceptions
ExceptionCondition
ArgumentNullExceptionterrain or road is .
Remarks

A road is defined by the specified 3D path. The path keys can be of type TerrainRoadPathKey. This allows to add additional information to the path, like varying road Width and SideFalloff. If the path keys are of any other PathKey3F type, the defaultWidth and defaultSideFalloff are used.

The heights of the given height field are adjusted to the road height - the road is "carved" into the terrain. At the side of the roads the terrain heights fall off smoothly to the existing terrain heights. The influence range on each side is defined by the SideFalloff in the TerrainRoadPathKeys or by the defaultSideFalloff.

See Also