Skip to main content

AnimationMixer3D

Struct AnimationMixer3D 

Source
pub struct AnimationMixer3D { /* private fields */ }
Expand description

Multi-layer glTF 2.0 & Blender NLA animation mixer supporting STEP/LINEAR/CUBICSPLINE channels, morph weights, and zero-allocation ticking.

Implementations§

Source§

impl AnimationMixer3D

Multi-layer glTF/NLA animation mixing and zero-allocation scene-graph application for AnimationMixer3D.

Source

pub fn capture_rest_pose(&mut self, scene_graph: &SceneGraph3D)

Captures the current SceneGraph3D local transforms and morph weights as the bind/rest pose and pre-reserves scratch buffers.

§Arguments
  • &Self - Mutable animation mixer.
  • &SceneGraph3D - Scene graph in its rest pose.
Source

pub fn add_clip(&mut self, clip: ImportedAnimationClip3D) -> usize

Registers an imported animation clip and returns its clip index.

§Arguments
  • &Self - Mutable animation mixer.
  • ImportedAnimationClip3D - Imported glTF/Blender animation clip.
§Returns
  • usize - Assigned index inside clips.
Source

pub fn push_layer(&mut self, layer: NlaLayer3D) -> usize

Appends an NlaLayer3D to the mixing stack and returns its layer index.

§Arguments
  • &Self - Mutable animation mixer.
  • NlaLayer3D - Playback layer descriptor.
§Returns
  • usize - Assigned index inside layers.
Source

pub fn crossfade_layer( &mut self, layer_index: usize, target_weight: f32, duration_secs: f32, ) -> bool

Triggers a smooth crossfade on layer_index toward target_weight over duration_secs.

§Arguments
  • &Self - Mutable animation mixer.
  • usize - Target layer index inside layers.
  • f32 - Destination blend weight in [0.0, 1.0].
  • f32 - Crossfade duration in seconds.
§Returns
  • bool - true when layer_index existed.
Source

pub fn clear_layers(&mut self)

Removes all active NLA playback layers while preserving registered clips and captured rest pose.

Source

pub fn advance_and_apply( &mut self, dt_secs: f32, scene_graph: &mut SceneGraph3D, ) -> usize

Advances all enabled NLA layers by dt_secs, mixes Override and Additive channels into reusable SoA scratch buffers, and writes modified TRS and morph weights directly into scene_graph with zero steady-state heap allocations.

§Arguments
  • &Self - Mutable animation mixer.
  • f32 - Elapsed frame delta time in seconds.
  • &mut SceneGraph3D - Target scene graph updated in place.
§Returns
  • usize - Number of scene nodes or morph channels updated during this tick.
Source§

impl AnimationMixer3D

Source

pub fn get_clips(&self) -> &Vec<ImportedAnimationClip3D>

Source

pub fn get_mut_clips(&mut self) -> &mut Vec<ImportedAnimationClip3D>

Source

pub fn set_clips(&mut self, val: Vec<ImportedAnimationClip3D>) -> &mut Self

Source

pub fn get_layers(&self) -> &Vec<NlaLayer3D>

Source

pub fn get_mut_layers(&mut self) -> &mut Vec<NlaLayer3D>

Source

pub fn set_layers(&mut self, val: Vec<NlaLayer3D>) -> &mut Self

Source

pub fn get_pose_scratch(&self) -> &AnimationPoseScratch3D

Source

pub fn get_mut_pose_scratch(&mut self) -> &mut AnimationPoseScratch3D

Source

pub fn set_pose_scratch(&mut self, val: AnimationPoseScratch3D) -> &mut Self

Source

pub fn get_rest_translations(&self) -> &Vec<Vec3>

Source

pub fn get_mut_rest_translations(&mut self) -> &mut Vec<Vec3>

Source

pub fn set_rest_translations(&mut self, val: Vec<Vec3>) -> &mut Self

Source

pub fn get_rest_rotations(&self) -> &Vec<Quat>

Source

pub fn get_mut_rest_rotations(&mut self) -> &mut Vec<Quat>

Source

pub fn set_rest_rotations(&mut self, val: Vec<Quat>) -> &mut Self

Source

pub fn get_rest_scales(&self) -> &Vec<Vec3>

Source

pub fn get_mut_rest_scales(&mut self) -> &mut Vec<Vec3>

Source

pub fn set_rest_scales(&mut self, val: Vec<Vec3>) -> &mut Self

Source

pub fn get_rest_morph_weights(&self) -> &Vec<f32>

Source

pub fn get_mut_rest_morph_weights(&mut self) -> &mut Vec<f32>

Source

pub fn set_rest_morph_weights(&mut self, val: Vec<f32>) -> &mut Self

Trait Implementations§

Source§

impl Clone for AnimationMixer3D

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnimationMixer3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AnimationMixer3D

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for AnimationMixer3D

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AnimationMixer3D

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.