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

class Model in Tinman.AddOns.Models

Default implementation of the IModel interface.

sealed class Model implements IModel

Public / Attributes

Batch

The primitive batch of this model in the geometry buffer.

public property Batch { get set }
type PrimitiveBatch
value The primitive batch or None.
implements IModel.Batch

See also:

IModel.Geometry

ChildCount

The number of child models.

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

Collider

The collider object for this model.

public property Collider { get }
type ModelCollider
value [not-null] The collider object.
implements IModel.Collider

Flags

The model flags.

public property Flags { get set }
type ModelFlags
value The model flags.
implements IModel.Flags

FrameCount

Returns the number of animation keyframes.

public property FrameCount { get }
type int32
value [>=0] The number of animation keyframes.
implements IModel.FrameCount

Geometry

The geometry of this model.

public property Geometry { get set }
type IModelGeometry
value The geometry or null.
implements IModel.Geometry

See also:

IModel.Batch

Material

The material of this model.

public property Material { get set }
type IMaterial
value The material or null.
implements IModel.Material

Remarks:

If the material of a model is null, the material of the parent model will be used.

Name

The name of this model.

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

Unit

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

public property Unit { get set }
type UnitOfMeasure
value The model-space unit of measure or null.
implements IModel.Unit

Remarks:

If the unit of measure of a model is null, the unit of measure of the parent model will be used. If the model does not have a parent, metres will be used (see Metre). assumed

Defaults to null.

Public / Constructors

Load

Loads a 3D model from a file using Any.

public static method Load (Path file)
type IModel
params file [not-null] The file path.
returns [not-null] The read model.

Loads a 3D model from a file using Any.

public static method Load (IFileData file)
type IModel
params file [not-null] The file data.
returns [not-null] The read model.

Model

Creates a new instance of Model.

public constructor Model (string name = null)
params name Initial value for Name. Defaults to null.

Creates a new instance of Model.

public constructor Model (IModelGeometry geometry, PrimitiveBatch batch, IMaterial material = null, ModelFlags flags = ModelFlags.Lighting | ModelFlags.FrontFaces, string name = null)
params geometry [not-null] Initial value for Geometry.
  batch Initial value for Batch.
  material Initial value for Material. Defaults to null.
  flags Initial value for Flags. Defaults to Lighting | FrontFaces.
  name Initial value for Name. Defaults to null.

Read

Reads a 3D model from a file using Any.

[OwnerReturn]
public static method Read (Path file)
type IModelReader
params file [not-null] The file path.
returns [not-null] The model reader.

Reads a 3D model from a file using Any.

[OwnerReturn]
public static method Read (IFileData file)
type IModelReader
params file [not-null] The file data.
returns [not-null] The model reader.

Public / Methods

ChildAdd

Adds a child model.

public method ChildAdd (IModel child)
type Model
params child [not-null] The model to add as a child.
returns [not-null] this

Adds a child model.

public method ChildAdd (IModel child, Mat4F transform)
type Model
params child [not-null] The model to add as a child.
  transform The child-to-parent transformation to use.
returns [not-null] this

ChildModelAt

Returns the index-th child model.

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

ChildRemove

Removes a child model.

public method ChildRemove (IModel child)
params child [not-null] The model to remove.

Remarks:

If the given model is not a child of this model, the method silently returns.

ChildTransformAt

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

[Pure]
public method ChildTransformAt (int32 index)
type Mat4F
params index [0..ChildCount-1] The child model index.
returns The transformation matrix.
implements IModel.ChildTransformAt

Remarks:

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

ColliderDirty

Invalidates the current ModelCollider instance for this model.

public method ColliderDirty ()

Remarks:

Call this method when the model structure has been modified. A new model collider will be created the next time the Collider property is get.

FrameAdd

Adds the given animation keyframe.

public method FrameAdd (Mat4F frame)
params frame The keyframe transformation.

FrameAt

Returns the index-th animation keyframe.

[Pure]
public method FrameAt (int32 index)
type Mat4F
params index The keyframe index.
returns The animation keyframe.
implements IModel.FrameAt

UseGeometryInstancing

Configures geometry instancing for this model.

public 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.
implements IModel.UseGeometryInstancing

See also:

IModelGeometry.InstanceBuffer