pub struct Binder;Expand description
Resolves animation clip track targets to logical bone indices via a Rig.
Two main workflows:
- Rig construction —
build_rigwalks the scene subtree to produce aRigwith ordered bone handles and paths. - Clip binding —
build_clip_bindingmaps each track’s path to a bone index, lazily recording rest poses for newly animated nodes.
Implementations§
Source§impl Binder
impl Binder
Sourcepub fn build_rig(target: &dyn AnimationTarget, root_node: NodeHandle) -> Rig
pub fn build_rig(target: &dyn AnimationTarget, root_node: NodeHandle) -> Rig
Builds a Rig by walking the subtree rooted at root_node.
Every named descendant (and the root itself) becomes a bone entry.
Bone paths are recorded relative to root_node so that the same
rig topology can be matched against multiple clips.
Sourcepub fn build_clip_binding(
target: &mut dyn AnimationTarget,
rig: &Rig,
clip: &AnimationClip,
) -> ClipBinding
pub fn build_clip_binding( target: &mut dyn AnimationTarget, rig: &Rig, clip: &AnimationClip, ) -> ClipBinding
Builds a ClipBinding mapping clip tracks to rig bone indices.
For every track whose crate::clip::TrackMeta::path matches a bone path in the
rig, a TrackBinding is emitted. Nodes receiving their first
animation binding get their current transform lazily recorded as
the rest pose.
Sourcepub fn bind(
target: &mut dyn AnimationTarget,
root_node: NodeHandle,
clip: &AnimationClip,
) -> (Rig, ClipBinding)
pub fn bind( target: &mut dyn AnimationTarget, root_node: NodeHandle, clip: &AnimationClip, ) -> (Rig, ClipBinding)
Convenience: builds a rig and a clip binding in one call.
Equivalent to calling build_rig followed by
build_clip_binding.
Auto Trait Implementations§
impl Freeze for Binder
impl RefUnwindSafe for Binder
impl Send for Binder
impl Sync for Binder
impl Unpin for Binder
impl UnsafeUnpin for Binder
impl UnwindSafe for Binder
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.