Click or drag to resize
DigitalRuneTerrainRoadLayerCreateMesh Method
Creates a road mesh for use with a TerrainRoadLayer.

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public static void CreateMesh(
	GraphicsDevice graphicsDevice,
	Path3F path,
	float defaultWidth,
	int maxNumberOfIterations,
	float tolerance,
	out Submesh submesh,
	out Aabb aabb,
	out float roadLength
)

Parameters

graphicsDevice
Type: GraphicsDevice
The graphics device.
path
Type: DigitalRune.Mathematics.InterpolationPath3F
The path that represents the road.
defaultWidth
Type: SystemSingle
The default road width.
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).
submesh
Type: DigitalRune.GraphicsSubmesh
The resulting road mesh - or if path is empty.
aabb
Type: DigitalRune.Geometry.ShapesAabb
The axis-aligned bounding box of the road mesh.
roadLength
Type: SystemSingle
The length of the road.
Exceptions
ExceptionCondition
ArgumentNullExceptiongraphicsDevice or path 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. If the path keys are of any other PathKey3F type, the defaultWidth is used.

To create the road mesh, the path is tessellated. maxNumberOfIterations and tolerance define how detailed the tessellation will be.

Limitations:

  • The path should not have any gaps.
See Also