SkinningBuffer

class SkinningBuffer(nativeHandle: NativePointer)

SkinningBuffer is used to hold skinning data (bones) for skeletal animation.

SkinningBuffer is a simple wrapper around a structured Uniform Buffer Object (UBO) that stores bone transformations. It is used by RenderableManager to deform vertices according to bone transformations and weights during skeletal animation (rigged animations).

Important constraint: Due to GLSL limitations, the SkinningBuffer size must always be a multiple of 256 bones. The builder automatically adjusts the requested bone count to meet this requirement, which may cause some memory overhead. This overhead can be mitigated by using the same SkinningBuffer to store bone information for multiple RenderPrimitives.

See also

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Types

Link copied to clipboard
class Builder

Builder for creating SkinningBuffer instances.

Properties

Link copied to clipboard

Gets the number of bones in this buffer.

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
fun setBones(engine: Engine, transforms: Array<RenderableManager.Bone>, count: Int = transforms.size, offset: Int = 0)
fun setBones(engine: Engine, transforms: FloatArray, count: Int = transforms.size / 16, offset: Int = 0)

Updates bone transforms in the range [offset, offset + count).