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.
impl AnimationMixer3D
Multi-layer glTF/NLA animation mixing and zero-allocation scene-graph application for AnimationMixer3D.
Sourcepub fn capture_rest_pose(&mut self, scene_graph: &SceneGraph3D)
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.
Sourcepub fn add_clip(&mut self, clip: ImportedAnimationClip3D) -> usize
pub fn add_clip(&mut self, clip: ImportedAnimationClip3D) -> usize
Sourcepub fn push_layer(&mut self, layer: NlaLayer3D) -> usize
pub fn push_layer(&mut self, layer: NlaLayer3D) -> usize
Sourcepub fn crossfade_layer(
&mut self,
layer_index: usize,
target_weight: f32,
duration_secs: f32,
) -> bool
pub fn crossfade_layer( &mut self, layer_index: usize, target_weight: f32, duration_secs: f32, ) -> bool
Sourcepub fn clear_layers(&mut self)
pub fn clear_layers(&mut self)
Removes all active NLA playback layers while preserving registered clips and captured rest pose.
Sourcepub fn advance_and_apply(
&mut self,
dt_secs: f32,
scene_graph: &mut SceneGraph3D,
) -> usize
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
impl AnimationMixer3D
pub fn get_clips(&self) -> &Vec<ImportedAnimationClip3D>
pub fn get_mut_clips(&mut self) -> &mut Vec<ImportedAnimationClip3D>
pub fn set_clips(&mut self, val: Vec<ImportedAnimationClip3D>) -> &mut Self
pub fn get_layers(&self) -> &Vec<NlaLayer3D>
pub fn get_mut_layers(&mut self) -> &mut Vec<NlaLayer3D>
pub fn set_layers(&mut self, val: Vec<NlaLayer3D>) -> &mut Self
pub fn get_pose_scratch(&self) -> &AnimationPoseScratch3D
pub fn get_mut_pose_scratch(&mut self) -> &mut AnimationPoseScratch3D
pub fn set_pose_scratch(&mut self, val: AnimationPoseScratch3D) -> &mut Self
pub fn get_rest_translations(&self) -> &Vec<Vec3>
pub fn get_mut_rest_translations(&mut self) -> &mut Vec<Vec3>
pub fn set_rest_translations(&mut self, val: Vec<Vec3>) -> &mut Self
pub fn get_rest_rotations(&self) -> &Vec<Quat>
pub fn get_mut_rest_rotations(&mut self) -> &mut Vec<Quat>
pub fn set_rest_rotations(&mut self, val: Vec<Quat>) -> &mut Self
pub fn get_rest_scales(&self) -> &Vec<Vec3>
pub fn get_mut_rest_scales(&mut self) -> &mut Vec<Vec3>
pub fn set_rest_scales(&mut self, val: Vec<Vec3>) -> &mut Self
pub fn get_rest_morph_weights(&self) -> &Vec<f32>
pub fn get_mut_rest_morph_weights(&mut self) -> &mut Vec<f32>
pub fn set_rest_morph_weights(&mut self, val: Vec<f32>) -> &mut Self
Trait Implementations§
Source§impl Clone for AnimationMixer3D
impl Clone for AnimationMixer3D
Source§impl Debug for AnimationMixer3D
impl Debug for AnimationMixer3D
Source§impl Default for AnimationMixer3D
impl Default for AnimationMixer3D
Source§impl PartialEq for AnimationMixer3D
impl PartialEq for AnimationMixer3D
impl StructuralPartialEq for AnimationMixer3D
Auto Trait Implementations§
impl Forget for AnimationMixer3D
impl Freeze for AnimationMixer3Dwhere
*const u8 is !null: Freeze,
PhantomData<ImportedAnimationClip3D>: Freeze,
PhantomData<NlaLayer3D>: Freeze,
PhantomData<Vec3>: Freeze,
PhantomData<Quat>: Freeze,
PhantomData<bool>: Freeze,
PhantomData<f32>: Freeze,
impl Move for AnimationMixer3D
impl RefUnwindSafe for AnimationMixer3D
impl Send for AnimationMixer3Dwhere
RawVecInner: Send,
impl Sync for AnimationMixer3Dwhere
RawVecInner: Sync,
impl Unpin for AnimationMixer3D
impl UnsafeUnpin for AnimationMixer3Dwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<ImportedAnimationClip3D>: UnsafeUnpin,
PhantomData<NlaLayer3D>: UnsafeUnpin,
PhantomData<Vec3>: UnsafeUnpin,
PhantomData<Quat>: UnsafeUnpin,
PhantomData<bool>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
impl UnwindSafe for AnimationMixer3Dwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more