TerrainModel

Description

sealed class Tinman.Engine.Components.TerrainModel

Describes a 3D model that is placed somewhere onto the terrain.

The position properties of the TerrainModel class refer to the coordinate origin of the model-space of Model.

Public / Constructors

TerrainModel

5 overloads


public constructor TerrainModel1 → ()

Creates a new instance of TerrainModel.


public constructor TerrainModel2 → (1)

withPose in : bool

Set Pose to a new ModelPose object?

Creates a new instance of TerrainModel.


public constructor TerrainModel3 → (1)

flags in : TerrainModelFlags

Initial value for Flags.

Creates a new instance of TerrainModel.


public constructor TerrainModel4 → (3)

model in : IModel

The initial value for Model.

withPose opt : bool = false

Set Pose to a new ModelPose object?

flags opt : TerrainModelFlags = TerrainModelFlags.Default

Initial value for Flags.

Creates a new instance of TerrainModel.


public constructor TerrainModel5 → (4)

transform in : AffineTransform

The initial value for Transform.

model opt : IModel = null

The initial value for Model.

withPose opt : bool = false

Set Pose to a new ModelPose object?

flags opt : TerrainModelFlags = TerrainModelFlags.Default

Initial value for Flags.

Creates a new instance of TerrainModel.

Public / Methods

Bounds


public method Bounds → (1)

bounds in : BoxSoup

[not-null]
The output box soup.

Outputs the bounds of this terrain model to the given box soup.

InstanceUpdate


public method InstanceUpdate → (2)

pose in : AffineTransform

The new instance pose.

color opt : int64 = ~0

The new instance color.

Updates the next model instance.

This method may only be called between calls to InstanceUpdateBegin and InstanceUpdateEnd.

InstanceUpdateBegin


public method InstanceUpdateBegin → (3)

view in : TerrainView

[not-null]
The terrain view.

first opt : int32 = 0

[0..TerrainModel.InstanceCount]
The first instance that will be updated.

count opt : int32 = -1

[-1..TerrainModel.InstanceCount-first]
The number of instances that will be updated. If -1, all remaining instances will be updated.

returns → int32

The number of instances that are expected to be updated subsequently, by calling the InstanceUpdate method once for each one.

Begins to update the instance data of this model for the given view.

InstanceUpdateEnd


public method InstanceUpdateEnd → ()

Ends the current instance data update.

Public / Attributes

Flags


public attribute Flags → (get,set)

value : TerrainModelFlags

The flags.

The behaviour flags of this 3D model.

InstanceCount


public attribute InstanceCount → (get,set)

value : int32

[>=0]
The number of model instances or 0 to disable instancing.

The number of model instances.

Defaults to 0.

InstanceRange


public attribute InstanceRange → (get,set)

value : RangeI

The model instance range.

The range of model instances to render.

If InstanceCount is zero, this property is ignored. Otherwise it is clamped to the valid range of instance indices.

Defaults to RangeI.Inv.

IsValid


public attribute IsValid → (get)

value : bool

true if this 3D model is value, false if not.

Is this 3D model valid?

Only valid models will be processed and rendered.

Model


public attribute Model → (get,set)

value : IModel

The 3D model or null.

The 3D model.

Defaults to null.

Pose


public attribute Pose → (get,set)

value : ModelPose

The 3D model pose or null.

The 3D model pose.

Defaults to null.

Transform


public attribute Transform → (get,set)

value : AffineTransform

The model transform.

The transformation from model-space (in terrain units) to terrain-space (in terrain units), not taking into account the model pose.

TransformUnitPose


public attribute TransformUnitPose → (get)

value : AffineTransform

The model transform.

The transformation from model-space (in model units) to terrain-space (in terrain units), taking into account the current model pose.