Click or drag to resize
DigitalRuneHeightFieldGetTriangle Method
Gets a triangle representing a part of a height field cell.

Namespace: DigitalRune.Geometry.Shapes
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
public Triangle GetTriangle(
	int indexX,
	int indexZ,
	bool second
)

Parameters

indexX
Type: SystemInt32
The cell index along WidthX.
indexZ
Type: SystemInt32
The cell index along WidthZ.
second
Type: SystemBoolean
If set to the triangle for the second cell half is returned; otherwise the triangle for the first cell half is returned.

Return Value

Type: Triangle
A triangle.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionindexX is out of range.
ArgumentOutOfRangeExceptionindexZ is out of range.
Remarks

Each cell of the height field array is approximated with 2 triangles. second decides which triangle is returned.

The cell indices start at (0, 0) for the first cell. The last cell has the indices (m-2, n-2) when the height field array is a float[m, n] array.

See Also