TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class TriangulationBuffer in Tinman.Terrain.Kernel

The TriangulationBuffer consume the output of a mesh triangulation process.

sealed class TriangulationBuffer implements ICapacity

See also:

Triangulator

Public / Attributes

Capacity

Returns the capacity of this object.

public property Capacity { get }
type int32
value [>=0] The capacity, in elements.
implements ICapacity.Capacity

HasOverflow

Returns if this triangulation buffer has overflown during the last triangulation process.

public property HasOverflow { get }
type bool
value true if an overflow has occurred, false if not.

See also:

Reset

IndexCount

Returns the number of vertex indices that have been generated.

public property IndexCount { get }
type int32
value [>=0] The number of vertex indices.

See also:

Indices

Indices

Returns the array that holds the generated vertex indices.

public property Indices { get }
type int32[]
value [not-null] The vertex indices array.

See also:

IndexCount

Mode

The triangulation mode that has been used to fill this triangulation buffer.

public property Mode { get set }
type TriangleMode
value The triangulation mode.

Remarks:

Defaults to TriangleStrip.

Orientation

The orientation of the triangles in the triangulation buffer.

public property Orientation { get set }
type TriangleOrientation
value The triangle orientation.

Remarks:

Defaults to CounterClockwise.

TriangleCount

Returns the number of triangles that have been generated.

public property TriangleCount { get }
type int32
value [>=0] The number of triangles.

Remarks:

This count includes degenerated triangles (i.e. triangles with duplicate indices).

ValidTriangleCount

Counts all non-degenerated triangles in this buffer.

public property ValidTriangleCount { get }
type int32
value [>=0] The number of non-degenerated triangles.

Remarks:

A non-degenerated triangle has three distinct indices.

Public / Constructors

TriangulationBuffer

Creates a new instance of TriangulationBuffer.

public constructor TriangulationBuffer (int32 capacity = 1048576)
params capacity [>0] The buffer capacity, in indices. Defaults to 1048576.

Public / Methods

Reset

Resets the buffer to a new capacity.

public method Reset (int32 capacity)
params capacity [>0] The buffer capacity, in indices.

Remarks:

Calling this method will invalidate the current triangulation result (if any).

Update

Updates the given index buffer.

public method Update (IIndexBuffer buffer, int32 bufferIndex = 0)
type bool
params buffer [not-null] The index buffer to update.
  bufferIndex [>=0] Offset of first index in buffer to write.
returns true if buffer has been updated, false if the given index buffer has not enough capacity.