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

interface IModel in Tinman.Engine.Models

Base interface for classes that represent 3D models.

interface IModel base of Model

Remarks

The coordinate space for untransformed 3D models is defined as follows:

The ground level is expected to be at Y-coordinate zero.

Attributes

ChildCount

The number of child models.

property ChildCount { get }
type int32
value [>=0] The child model count.

See also:

ChildAt
ChildTransformAt

Collider

The collider object for this model.

property Collider { get }
type IModelCollider
value [not-null] The collider object.

Flags

The model flags.

property Flags { get }
type ModelFlags
value The model flags.

Name

The name of this model.

property Name { get }
type string
value The model name, will either be null or non-empty.

PartCount

The number of model parts.

property PartCount { get }
type int32
value [>=0] The model part count.

See also:

PartAt

Unit

The unit of measure in which model-space coordinates are expressed.

property Unit { get }
type UnitOfMeasure
value The model-space unit. If set to null, the default value is returned instead.

Remarks:

Defaults to Metre.

Extensions

ChildFor

Returns the first child model of the given name (see Name).

[Pure]
method ChildFor (string name)
type IModel
params name The model name.
returns The first matching child model or null if there is none.

ChildTransformWithUnitScaleAt

Returns the child-to-parent transformation matrix of the index-th child model.

[Pure]
method ChildTransformWithUnitScaleAt (int32 index)
type AffineTransform
params index [0..model.ChildCount-1] The child model index.
returns The transformation matrix.

Remarks:

The transformation matrix uses the unit of measure of the child model (see Unit).

See also:

ChildAt

Traverse

Traverses this model hierarchy and performs the given action at each node.

method Traverse (ModelDelegate action, bool includeThis = true, bool includeChildren = true, int32 level = 0)
params action [not-null] The model action to perform.
  includeThis Invoke action for this model?
  includeChildren Invoke action for descendant models?
  level [>=0] The model hierarchy level, where 0 represents the top-most model of the traversal, which is not necessarily the root model of the hierarchy.

UnitScale

Returns the scale factor for the give model, based on the specified unit of measure.

[Pure]
method UnitScale (UnitOfMeasure unit = null)
type float64
params unit The target unit of measure. If null, metres will be used. Defaults to null.
returns The scale factor from model units to target units.

Wrap

Wraps this model in a IModelReader.

[OwnerReturn]
method Wrap ()
type IModelReader
returns [not-null] The IModelReader that wraps this model.

Methods

ChildAt

Returns the index-th child model.

[Pure]
method ChildAt (int32 index)
type IModel
params index [0..ChildCount-1] The child model index.
returns [not-null] The child model.

See also:

ChildTransformAt

ChildTransformAt

Returns the child-to-parent transformation matrix of the index-th child model.

[Pure]
method ChildTransformAt (int32 index)
type AffineTransform
params index [0..ChildCount-1] The child model index.
returns The transformation from the child model to this model as parent.

Remarks:

The transformation matrix uses the unit of measure of the parent model (see Unit).

See also:

ChildAt

ColliderLoad

Initializes the Collider object from the given precomputed spatial data structures.

method ColliderLoad (ISerializable data)
params data The precomputed spatial data structures.

Remarks:

As an alternative to this method, the ComplexGeometry flag may be used.

If the given data is unsuitable, this method will return silently and a new IModelCollider will be computed.

See also:

IModelCollider.Save

PartAt

Returns the index-th model part.

[Pure]
method PartAt (int32 index)
type IModelPart
params index [0..PartCount-1] The model part index.
returns [not-null] The model part.

PrepareLazy

Prepares all lazy-loaded data for this model.

method PrepareLazy ()
type IModel
returns [not-null] this

Exceptions:

UseGeometryInstancing

Configures geometry instancing for this model.

method UseGeometryInstancing (IResourceHandle instanceBuffer)
type IModel
params instanceBuffer The resource handle that returns an IVertexBuffer object that holds instance data to use for this model object or null to disable geometry instancing. The instanceBuffer value will be returned by the InstanceBuffer property of the geometry objects of the returned model and all its descendants.
returns [not-null] The resulting model.

See also:

IModelGeometry.InstanceBuffer