Logo Mibo

AnimatedMesh Module

Functions and values

Function or value Description

computeBoneMatrices clip frame mesh

Full Usage: computeBoneMatrices clip frame mesh

Parameters:
Returns: Matrix4x4[]

Compute bone matrices for a given animation clip and frame.

This is pure math — does not mutate the model. The result can be passed directly to DrawSkinnedMesh for GPU skinning. The algorithm matches raylib's UpdateModelAnimation: interpolates keyframes (lerp/slerp), builds TRS matrices, and multiplies by the inverse bind pose. The result is kept in plain System.Numerics row-major layout (InverseBindPose[i] * pose[i], NOT transposed) so the instanced palette-texture upload copies it verbatim; consumers that upload through SetShaderValueMatrix transpose at upload time. clip is sampled by raw bone index — this path does NOT apply the bone-order remaps built by Animation3DClips.merge. Clips from a merged clip set must be played through Animation3DState.computePose (or AnimatedModel), the only remap-aware path; feeding a merged clip here drives the wrong bones (typically seen as mirrored limbs).

clip : ModelAnimation
frame : float32
mesh : AnimatedMesh
Returns: Matrix4x4[]

fromModel model

Full Usage: fromModel model

Parameters:
Returns: AnimatedMesh voption

Extract an AnimatedMesh from a loaded Model.

The model must have been loaded from a file that contains skeleton data (glb/gltf/iqm). Returns ValueNone if the model has no bones.

model : Model
Returns: AnimatedMesh voption

tryFindBoneIndex name mesh

Full Usage: tryFindBoneIndex name mesh

Parameters:
Returns: int voption
Modifiers: inline

Try to find the index of a bone by its authored name. Returns ValueNone when the mesh has no bone with that name.

name : string
mesh : AnimatedMesh
Returns: int voption

Type something to start searching.