Logo Mibo

Animation3DState Module

Functions and values

Function or value Description

applyToModel state

Full Usage: applyToModel state

Parameters:

Apply the current animation frame to the model's bone matrices.

Calls Raylib.UpdateModelAnimation (or UpdateModelAnimationEx when blending) which mutates the model's internal bone data. Must be called before rendering with DrawModel.

state : Animation3DState

blendTo clipName duration state

Full Usage: blendTo clipName duration state

Parameters:
    clipName : string - The animation to blend towards.
    duration : float32 - The blend duration in seconds.
    state : Animation3DState

Returns: Animation3DState
Modifiers: inline

Start blending from the current animation to a target animation.

clipName : string

The animation to blend towards.

duration : float32

The blend duration in seconds.

state : Animation3DState
Returns: Animation3DState

blendToByIndex clipIndex duration state

Full Usage: blendToByIndex clipIndex duration state

Parameters:
Returns: Animation3DState
Modifiers: inline

Start blending to a target animation by clip index.

clipIndex : int
duration : float32
state : Animation3DState
Returns: Animation3DState

computePose mesh state

Full Usage: computePose mesh state

Parameters:
Returns: BonePose
Modifiers: inline

Compute the full bone pose for the current animation frame.

Keyframe poses are already model-space, so no parent-chain composition is needed (unlike the MonoGame backend). WorldPoses is transposed into raylib's native matrix layout (composes with Raymath.* ops); Palette is kept in plain System.Numerics row-major layout (Palette[i] = InverseBindPose[i] * pose[i]) so the instanced palette-texture upload can copy the array verbatim.

mesh : AnimatedMesh
state : Animation3DState
Returns: BonePose

computePoseInto mesh state existing

Full Usage: computePoseInto mesh state existing

Parameters:
Returns: BonePose

Evaluate the current pose of state on mesh once, producing both the model-space bone transforms for the current frame (WorldPoses) and the shader skinning palette (Palette).

Pure math — does not mutate the model (unlike applyToModel). Uses the same TRS sampling as AnimatedMesh.computeBoneMatrices; when the state is blending, both clips are sampled and blended by BlendProgress, mirroring the applyToModel branch. raylib keyframe poses are model-space, so the world pose is the sampled pose directly (no parent walk). WorldPoses is transposed into raylib's native matrix layout (composes with Raymath.* ops); Palette is kept in plain System.Numerics row-major layout (Palette[i] = InverseBindPose[i] * pose[i]) so the instanced palette-texture upload can copy the array verbatim — consumers that upload through SetShaderValueMatrix transpose at upload time instead.

mesh : AnimatedMesh
state : Animation3DState
existing : BonePose
Returns: BonePose

create model clips clipName fps

Full Usage: create model clips clipName fps

Parameters:
    model : Model - The model to animate. Must be a unique instance per entity.
    clips : Animation3DClips - The loaded animation clip set.
    clipName : string - The name of the animation to start on.
    fps : float32 - The animation playback speed in frames per second.

Returns: Animation3DState

Create a new 3D animation state starting on the specified clip.

Also uploads the mesh's bone attribute VBOs when the native raylib build skipped them (stock NuGet builds do — see SUPPORT_GPU_SKINNING), so UpdateModelAnimation skinning works out of the box.

model : Model

The model to animate. Must be a unique instance per entity.

clips : Animation3DClips

The loaded animation clip set.

clipName : string

The name of the animation to start on.

fps : float32

The animation playback speed in frames per second.

Returns: Animation3DState

createByIndex model clips clipIndex fps

Full Usage: createByIndex model clips clipIndex fps

Parameters:
Returns: Animation3DState

Create a new 3D animation state starting on the specified clip index.

See create — also ensures bone attribute VBOs are uploaded.

model : Model
clips : Animation3DClips
clipIndex : int
fps : float32
Returns: Animation3DState

currentClipName state

Full Usage: currentClipName state

Parameters:
Returns: string

Get the name of the current animation clip.

state : Animation3DState
Returns: string

duration state

Full Usage: duration state

Parameters:
Returns: float32
Modifiers: inline

Get the total duration of the current clip in seconds at the current speed.

state : Animation3DState
Returns: float32

isBlending state

Full Usage: isBlending state

Parameters:
Returns: bool
Modifiers: inline

Is currently blending between two animations?

state : Animation3DState
Returns: bool

isFinished state

Full Usage: isFinished state

Parameters:
Returns: bool
Modifiers: inline

Is the current animation finished? (always false for looping animations).

state : Animation3DState
Returns: bool

isPlaying clipName state

Full Usage: isPlaying clipName state

Parameters:
Returns: bool
Modifiers: inline

Is currently playing the specified animation?

clipName : string
state : Animation3DState
Returns: bool

play clipName state

Full Usage: play clipName state

Parameters:
Returns: Animation3DState
Modifiers: inline

Play an animation by name. Resets the frame if switching clips.

clipName : string
state : Animation3DState
Returns: Animation3DState

playByIndex clipIndex state

Full Usage: playByIndex clipIndex state

Parameters:
Returns: Animation3DState
Modifiers: inline

Play by clip index (zero string allocation).

clipIndex : int
state : Animation3DState
Returns: Animation3DState

playIfNot clipName state

Full Usage: playIfNot clipName state

Parameters:
Returns: Animation3DState
Modifiers: inline

Play animation only if not already playing it.

clipName : string
state : Animation3DState
Returns: Animation3DState

restart state

Full Usage: restart state

Parameters:
Returns: Animation3DState
Modifiers: inline

Force restart the current animation from the beginning.

state : Animation3DState
Returns: Animation3DState

update deltaSeconds state

Full Usage: update deltaSeconds state

Parameters:
Returns: Animation3DState
Modifiers: inline

Advance the animation by delta time.

Call from your Elmish update function each frame. Does not apply to the model — use applyToModel after.

deltaSeconds : float32
state : Animation3DState
Returns: Animation3DState

withLoop loop state

Full Usage: withLoop loop state

Parameters:
Returns: Animation3DState
Modifiers: inline
loop : bool
state : Animation3DState
Returns: Animation3DState

withSpeed speed state

Full Usage: withSpeed speed state

Parameters:
Returns: Animation3DState
Modifiers: inline
speed : float32
state : Animation3DState
Returns: Animation3DState

Type something to start searching.