pub struct Animator {
pub layers: Vec<AnimLayer>,
pub clips: HashMap<String, AnimClip>,
pub params: AnimParamSet,
pub use_root_motion: bool,
/* private fields */
}Expand description
Top-level animator: holds layers, clips, and parameter set. This is the main entry point for animation.
Fields§
§layers: Vec<AnimLayer>§clips: HashMap<String, AnimClip>§params: AnimParamSet§use_root_motion: boolWhether to extract root motion.
Implementations§
Source§impl Animator
impl Animator
pub fn new() -> Self
pub fn add_clip(&mut self, clip: AnimClip)
pub fn add_layer(&mut self, layer: AnimLayer)
pub fn set_float(&mut self, n: &str, v: f32)
pub fn set_int(&mut self, n: &str, v: i32)
pub fn set_bool(&mut self, n: &str, v: bool)
pub fn set_trigger(&mut self, n: &str)
Sourcepub fn consume_root_motion(&mut self) -> (f32, f32, f32)
pub fn consume_root_motion(&mut self) -> (f32, f32, f32)
Consume and return accumulated root motion delta.
Sourcepub fn drain_events(&mut self) -> Vec<AnimEvent>
pub fn drain_events(&mut self) -> Vec<AnimEvent>
Drain all fired events from all layers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Animator
impl RefUnwindSafe for Animator
impl Send for Animator
impl Sync for Animator
impl Unpin for Animator
impl UnsafeUnpin for Animator
impl UnwindSafe for Animator
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.