Logo Mibo

AnimatedModel Module

Pure update functions for AnimatedModel.

Mirrors the 2D AnimatedSprite module. Each function returns a new AnimatedModel. Playback delegates to Animation3DState; bone computation happens at draw time, not here.

Functions and values

Function or value Description

blendTo clipName duration am

Full Usage: blendTo clipName duration am

Parameters:
Returns: AnimatedModel
Modifiers: inline

Start blending toward a target animation.

clipName : string
duration : float32
am : AnimatedModel
Returns: AnimatedModel

computePose am

Full Usage: computePose am

Parameters:
Returns: BonePose voption
Modifiers: inline

Evaluate the model's pose for the current frame: per-bone world transforms plus the skinning palette. ValueNone when the model has no skeleton (am.Mesh is ValueNone).

Compute this once per instance per frame and share the result between the skinned draw (Draw.animatedModel(..., pose)) and any bone queries / attachment draws — the caller owns the BonePose value.

am : AnimatedModel
Returns: BonePose voption

computePoseInto am existing

Full Usage: computePoseInto am existing

Parameters:
Returns: BonePose voption
Modifiers: inline

Compute the bone pose into caller-owned arrays (zero per-frame allocation after the first call). Pass the previous frame's BonePose (or BonePose.empty on the first call) — arrays are grown on demand and reused on subsequent calls. Returns ValueNone when the model has no skeleton.

am : AnimatedModel
existing : BonePose
Returns: BonePose voption

create model mesh clips clipName fps

Full Usage: create model mesh clips clipName fps

Parameters:
    model : Model - The MonoGame model (meshes/textures).
    mesh : AnimatedMesh voption - Shared skeleton data (ValueNone for a boneless model).
    clips : Animation3DClips - Shared animation clip set (from IAssets.ModelAnimations).
    clipName : string - The animation to start on (falls back to clip 0 if absent).
    fps : float32 - Playback speed in frames per second.

Returns: AnimatedModel
Modifiers: inline

Create an animated model starting on the named clip.

model : Model

The MonoGame model (meshes/textures).

mesh : AnimatedMesh voption

Shared skeleton data (ValueNone for a boneless model).

clips : Animation3DClips

Shared animation clip set (from IAssets.ModelAnimations).

clipName : string

The animation to start on (falls back to clip 0 if absent).

fps : float32

Playback speed in frames per second.

Returns: AnimatedModel

currentClipName am

Full Usage: currentClipName am

Parameters:
Returns: string
Modifiers: inline

Name of the current clip.

am : AnimatedModel
Returns: string

duration am

Full Usage: duration am

Parameters:
Returns: float32
Modifiers: inline

Total duration of the current clip in seconds at the current speed.

am : AnimatedModel
Returns: float32

isFinished am

Full Usage: isFinished am

Parameters:
Returns: bool
Modifiers: inline

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

am : AnimatedModel
Returns: bool

isPlaying clipName am

Full Usage: isPlaying clipName am

Parameters:
Returns: bool
Modifiers: inline

Is currently playing the specified animation?

clipName : string
am : AnimatedModel
Returns: bool

play clipName am

Full Usage: play clipName am

Parameters:
Returns: AnimatedModel
Modifiers: inline

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

clipName : string
am : AnimatedModel
Returns: AnimatedModel

playByIndex clipIndex am

Full Usage: playByIndex clipIndex am

Parameters:
Returns: AnimatedModel
Modifiers: inline

Play by clip index (zero string allocation).

clipIndex : int
am : AnimatedModel
Returns: AnimatedModel

playIfNot clipName am

Full Usage: playIfNot clipName am

Parameters:
Returns: AnimatedModel
Modifiers: inline

Play only if not already playing it.

clipName : string
am : AnimatedModel
Returns: AnimatedModel

restart am

Full Usage: restart am

Parameters:
Returns: AnimatedModel
Modifiers: inline

Force restart the current animation.

am : AnimatedModel
Returns: AnimatedModel

tryGetBoneWorld bone am

Full Usage: tryGetBoneWorld bone am

Parameters:
Returns: Matrix voption
Modifiers: inline

Get the current model-space world transform of a bone, addressed by name or index. ValueNone when the model has no skeleton or the bone is missing — missing bones are never an error.

Convenience that recomputes the pose on every call. When several bones are queried in the same frame, use computePose once and query the resulting BonePose with BonePose.worldAt / BonePose.tryGetWorld instead.

bone : BoneRef
am : AnimatedModel
Returns: Matrix voption

update deltaSeconds am

Full Usage: update deltaSeconds am

Parameters:
Returns: AnimatedModel
Modifiers: inline

Advance playback by delta seconds. Pure; returns a new state.

deltaSeconds : float32
am : AnimatedModel
Returns: AnimatedModel

withLoop loop am

Full Usage: withLoop loop am

Parameters:
Returns: AnimatedModel
Modifiers: inline

Set whether the current clip loops.

loop : bool
am : AnimatedModel
Returns: AnimatedModel

withSpeed speed am

Full Usage: withSpeed speed am

Parameters:
Returns: AnimatedModel
Modifiers: inline

Set the playback speed multiplier.

speed : float32
am : AnimatedModel
Returns: AnimatedModel

Type something to start searching.