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

class MeshChunk in Tinman.Terrain.Kernel

A static mesh chunk.

sealed class MeshChunk extends Disposable
  implements ICapacity
  IMesh

Remarks

The mesh vertices are specified in terrain-space (see Position). However, a local coordinate system (see Matrix) around the mesh chunk center vertex (see Sector) is provided, as defined by the ComputeLocal method family of the IGeometry interface.

See also:

MeshChunkBuilder

Public / Attributes

Capacity

Returns the capacity of this object.

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

Geometry

The IGeometry object this terrain mesh uses.

[Constant]
public property Geometry { get }
type IGeometry
value [not-null] The geometry object.
implements IMesh.Geometry

Remarks:

The geometry object is used to compute actual vertex data from the terrain data that has been gathered from the heightmap.

See also:

IMesh.Heightmap

Heightmap

The heightmap of this terrain mesh.

[Constant]
public property Heightmap { get }
type IHeightmap
value [not-null] The heightmap.
implements IMesh.Heightmap

Remarks:

The heightmap delivers terrain data, such as elevation and diffuse color.

See also:

IMesh.Geometry

Indices

Returns a triangle strip for this mesh chunk.

public property Indices { get }
type int32[]
value [not-null] The triangle strip, created with default TriangulationBuffer options.

IsReady

Is this terrain mesh ready for traversal and triangulation?

public property IsReady { get }
type bool
value true if this mesh is ready, false if not.
implements IMesh.IsReady

Remarks:

When a mesh is not ready yet, calling GetRoot will always return Null.

IsSoleOwnership

Will this object be disposed upon the next call to Dispose?

[ThreadSafe]
public property IsSoleOwnership { get }
type bool
value true if the object will be disposed when Dispose is called,
false if the object will not be disposed, because some other code is still holding shared ownership (see AcquireThrow).
inherited Disposable.IsSoleOwnership

LifecycleState

Returns the lifecycle state of this object.

public property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState

Matrix

The transformation from local chunk coordinates to terrain-space coordinates.

public property Matrix { get }
type Mat4D
value The transformation matrix.

QualityThreshold

The average quality threshold of this mesh chunk.

public property QualityThreshold { get }
type float64
value The average quality threshold.

See also:

IMeshDynamic.QualityThreshold

Sector

Returns the mesh vertex that represents the root sector of the mesh chunk.

public property Sector { get }
type int32
value The mesh vertex that represents this mesh chunk.

Remarks:

Since a mesh chunk is a complete CLOD mesh, it also contains a minimal outer mesh that surrounds the actual mesh chunk area.

TaskGroup

The task group that is used by this mesh for background computations.

[Constant]
public property TaskGroup { get }
type TaskGroup
value [not-null] The task group.
implements IMesh.TaskGroup

Textures

The layer textures of this mesh chunk.

public property Textures { get }
type IMapConst<string, TexelBuffer>
value [not-null] Mapping from layer name to layer texture.

Tile

The pyramid tile coordinates of this mesh chunk.

public property Tile { get }
type PyramidCoords
value The pyramid tile coordinates.

Tree

Returns the mesh quad-tree object which can be used during traversals.

[Constant]
public property Tree { get }
type MeshTree
value [not-null] The mesh structure helper object.
implements IMesh.Tree

Remarks:

Each mesh face (see CubemapFace) represents the root of a quad-tree structure. During mesh traversal (via the IMeshTraversal), the MeshTree object provides access to the underlying quad-tree structure.

Triangulator

Return the Triangulator object to use for mesh triangulation.

[Constant]
public property Triangulator { get }
type Triangulator
value [not-null] The Triangulator instance.
implements IMesh.Triangulator

Version

Returns the current version of object.

public property Version { get }
type int32
value The current version number.
implements IVersioned.Version

Remarks:

For each modification, the version is incremented by at least one.

VertexCount

The number of mesh vertices.

public property VertexCount { get }
type int32
value [&lt;=Capacity] the number of mesh vertices.

Vertices

Returns the CPU vertex data collection of this terrain mesh.

[Constant]
public property Vertices { get }
type VertexArrays
value [not-null] The vertex data collection.
implements IMesh.Vertices

Remarks:

All meshes created by a single MeshBuffer share the same vertex data collection.

Public / Methods

AcquireBase

Acquires a strong reference to this disposable object.

[OwnerReturn, Pure]
public method AcquireBase ()
type IDisposable
returns The strong reference to this disposable object or null iff this object is no longer valid.
inherited Disposable.AcquireBase

Remarks:

The object will not be actually disposed by calls to IDisposable when there is at least one strong reference left. Code that calls this method is responsible for calling the IDisposable method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

Using this method usually requires type casting. Subclasses may additionally implement IDisposableGeneric, in order to provide some syntactic sugar for that.

AcquireThrow

Acquires a strong reference to this disposable object.

[OwnerReturn, Pure]
public method AcquireThrow ()
type IDisposable
returns [not-null] The strong reference to this disposable object.
inherited Disposable.AcquireThrow

Remarks:

The object will not be actually disposed by calls to IDisposable when there is at least one strong reference left. Code that calls this method is responsible for calling the IDisposable method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

Exceptions:

Dispose

Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.

[Dispose, OwnerThis, ThreadSafe]
public method Dispose ()
inherited Disposable.Dispose

Remarks:

The Dispose method silently returns if the object has already been disposed.

Implementing methods must not throw any exceptions.