InstanceBuffer

class InstanceBuffer(nativeHandle: NativePointer)

Per-instance local transforms for a renderable drawn with RenderableManager.Builder.instances. Each transform is relative to the renderable's, so moving the renderable moves all its instances. Transforms are column-major mat4fs, 16 floats each. Destroy it with Engine.destroy, after the renderables that use it.

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Types

Link copied to clipboard
class Builder(instanceCount: Int)

Builds an InstanceBuffer of instanceCount instances, 1 to Engine.maxAutomaticInstances.

Properties

Link copied to clipboard

The instance count given to the Builder.

Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Functions

Link copied to clipboard

The local transform of instance index, a mat4f.

Link copied to clipboard
fun setLocalTransforms(localTransforms: FloatArray, count: Int = localTransforms.size / 16, offset: Int = 0)

Sets count local transforms (mat4fs in localTransforms), starting at instance offset.