Skip to main content

Crate wde_animation

Crate wde_animation 

Source
Expand description

Rigid-part animation for WaterDropEngine.

A model is animated by moving rigid parts: each part hangs under an AnimationBone entity, whose transform is driven by an AnimationClip (one keyframe track per bone name). An AnimationPlayer on the root of the hierarchy plays and crossfades clips onto every bone below it.

§Example

glTF models with %B%<bone> nodes spawn their bones automatically, and expose their clips:

fn walk(mut players: Query<&mut AnimationPlayer>, gltf: Res<Assets<GltfAsset>>, model: Res<Model>) {
    let walk = gltf.get(&model.0).unwrap().animation("Walk").unwrap();
    for mut player in &mut players {
        player.crossfade(walk.clone(), 0.2).set_speed(1.5);
    }
}

Structs§

AnimationBone
Rigid part of an animated model, posed by the AnimationPlayer of its closest ancestor.
AnimationClip
Keyframed animation of a set of bones, identified by name.
AnimationPlayer
Plays clips (looping, or once) on the AnimationBones below its entity, blending smoothly from one clip to the next.
AnimationPlugin
AnimationSystems
Systems advancing the players and posing the bones, in [Update].
BoneTrack
Animation of one bone. Missing channels keep the bone’s rest value.
Keyframes
Values over time, sorted by time.

Enums§

Interpolation
How values are interpolated between two keyframes.