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 a Y-coordinate zero.

Attributes

Batch

The primitive batch of this model in the geometry buffer.

property Batch { get }
type PrimitiveBatch
value The primitive batch or None.

See also:

Geometry

ChildCount

The number of child models.

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

Collider

The collider object for this model.

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

Flags

The model flags.

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

FrameCount

Returns the number of animation keyframes.

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

Geometry

The geometry of this model.

property Geometry { get }
type IModelGeometry
value The geometry or null.

See also:

Batch

Material

The material of this model.

property Material { get }
type IMaterial
value The material or null.

Remarks:

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

Name

The name of this model.

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

Unit

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

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

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.

Methods

ChildModelAt

Returns the index-th child model.

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

ChildTransformAt

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

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

Remarks:

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

FrameAt

Returns the index-th animation keyframe.

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

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

Extensions

ChildModelFor

method ChildModelFor (string name)
type IModel
params name

DistanceTo

method DistanceTo (Vec3D point)
type float64
params point

Filter

Traverses the given model hierarchy and applies the given filter.

[Pure]
method Filter (ModelDelegate filter, IVector<IModel> result = null)
type bool
params filter [not-null] The filter delegate to apply to each model node.
  result Optional output for model nodes that have passed the given filter.
returns true if at least one model node has passed the given filter, false if no model nodes have passed.

FrameGet

method FrameGet (float32 index)
type Mat4F
params index

HasWind

Does this model have at least one geometry node with the VertexColorIsWind flag?

method HasWind ()
type bool
returns true if there is at least one VertexColorIsWind node, false if not.

PickRay

method PickRay (Vec3D origin, Vec3D direction, out Vec3D point, out Vec3D normal)
type bool
params origin
  direction
  point
  normal