ZSkinning

@Serializable(with = ZSkinningSerializer::class)
class ZSkinning : ZSerializableComponent<ZSkinningData> (source)

Skin binding between a mesh and a skeleton for skeletal animation.

Holds the list of bone IDs that influence the mesh, their per-bone inverse bind matrices, and an optional skin-level bind matrix pair used when the mesh node and skeleton root do not share the same transform (e.g. in glTF when skin and mesh are on different nodes).

Typically created by loaders/exporters and attached to a ZModel together with a ZSkeleton.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Ordered list of bone IDs that influence this skin. Order must match inverseBindMatrices.

Link copied to clipboard
override val data: ZSkinningData

Provides access to the component's serializable data.

Link copied to clipboard

Per-bone inverse bind matrices (bind pose bone world → bone local). One per entry in boneIds.

Link copied to clipboard

Inverse of modelSkinBindMatrix. Transforms from skeleton space back to mesh local space.

Link copied to clipboard
override val isInitialized: Boolean

Represents a boolean value indicating whether a component has been initialized.

Link copied to clipboard
override val isRenderizable: Boolean

Represents a boolean value indicating whether a component is renderizable.

Link copied to clipboard

Transform from mesh local space to skeleton (bind) space at bind time. Use identity when the mesh and skeleton share the same node; set from asset data when they differ (e.g. glTF skin on a different node than the mesh).

Link copied to clipboard
override val refId: String

Represents the unique identifier for a reference-based component. The refId is used as a distinctive key for retrieving or linking this component within reference-dependent systems.

Functions

Link copied to clipboard
fun addBoneId(boneId: String)

Appends a bone ID to the skin.

Link copied to clipboard

Appends all matrices to the inverse bind matrix list. Order must match boneIds.

Link copied to clipboard

Appends a single inverse bind matrix. Order must match boneIds.

fun addInverseBindMatrix(idx: Int, matrix: ZMatrix4)

Inserts matrix at idx in the inverse bind matrix list.

Link copied to clipboard
override fun dispose()

Disposes the component and releases resources. Idempotent: multiple calls are safe. Subclasses with own state to release should override internalDispose.

Link copied to clipboard
open override fun initialize(ctx: ZRenderingContext)

Initializes the ZComponent using the provided ZRenderingContext.

Link copied to clipboard
fun removeBoneId(boneId: String)

Removes the first occurrence of boneId from the skin.