IModelGeometry

Description

interface Tinman.Engine.Models.IModelGeometry

Base interface for classes that represent geometry (vertices and indices) for 3D models.

IModelGeometry objects act as resource handles and produce ModelGeometryBuffer resource objects.

Public / Methods

Append


public method Append → (1)

other in : IModelGeometry

[not-null]
The model geometry to append to this one.

returns → IModelGeometry

The resulting model geometry.

Concatenates the vertices and indices of this model geometry and the given other in one.

No processing is performed when this method is called. Instead, the source model geometries are processed lazily, when ReadIndices or ReadVertices is called, yielding the following results:

  • IndexCount
    The index counts of the source model geometries are added.

  • InstanceBuffer
    The instance buffers that are present in the source model geometries are ignored. The resulting model geometry will always be non-instanced.

  • VertexCount
    The vertex counts of the source model geometries are added.

  • VertexFormat
    The vertex format flags are combined. To avoid creation of unused vertex data, the source model geometries should have the same format.

All PrimitiveBatch values that refer to this model geometry can also be used for the resulting model geometry, without adjustment. The PrimitiveBatch values for other in must be adjusted as follows:

Dynamic


public method Dynamic → ()

returns → IModelGeometryDynamic

The dynamic model geometry.

Makes this model geometry dynamic.

If necessary, a new model geometry is created by copying index and vertex data from this model geometry.

IOException

If an I/O exception has occurred.

Optimized


public method Optimized → ()

returns → IModelGeometry

The optimized geometry, without instancing. Will be this if ReadIndices return null.

Optimizes this model geometry by reordering those vertices that are actually referenced by the index data.

Read​Indices


public method ReadIndices → ()

returns → int32 [ ]

The vertex index data or null iff IndexCount returns 0 (i.e. the geometry is not indexed).

Read vertex index data.

IOException

If an I/O exception has occurred.

Read​Vertices


public method ReadVertices → ()

returns → VertexArrays

The vertex data array.

Reads vertex data.

IOException

If an I/O exception has occurred.

Reduced


public method Reduced → (1)

reduced in : bool

Use 32-bit floating-point precision (true) or 64-bit floating-point precision ( false)?

returns → IModelGeometry

The reduced geometry.

Reduce the floating-point precision for this model geometry?

Using reduced precision will consume less memory resp. storage space, but might introduce jitter artefacts during rendering.

Transform


public method Transform → (1)

matrix in : Mat4D

The transformation matrix.

returns → IModelGeometry

The transformed geometry.

Transforms the model geometry vertices using the given matrix.

Use​Instance​Buffer


public method UseInstanceBuffer → (1)

instanceBuffer in : IResourceHandle

The instance buffer (see InstanceBuffer) or null to disable dynamic geometry instancing.

returns → IModelGeometry

The resulting model geometry.

Configures geometry instancing for this model geometry.

Public / Attributes

Index​Count


public attribute IndexCount → (get)

value : int32

[>=0]
The vertex index count. Will be 0 iff ReadIndices returns null.

The vertex index count.

Instance​Buffer


public attribute InstanceBuffer → (get)

value : IResourceHandle

The instance buffer to use for this model geometry object or null if geometry instancing is disabled, see UseInstanceBuffer.

The resource handle that returns a IVertexBuffer object that holds dynamic instance data to use for this model geometry object.

Vertex​Count


public attribute VertexCount → (get)

value : int32

[>0]
The vertex count.

The vertex count.

Vertex​Format


public attribute VertexFormat → (get)

value : ModelVertexFormat

The format flags.

The vertex format flags.