pub struct BlendShapeAnimator {
pub time: f32,
pub speed: f32,
/* private fields */
}Expand description
Drives blend-shape weights via time-varying F32 keyframe tracks.
Fields§
§time: f32Current playback time (seconds).
speed: f32Implementations§
Source§impl BlendShapeAnimator
impl BlendShapeAnimator
pub fn new() -> Self
Sourcepub fn add_track(&mut self, shape_name: impl Into<String>, keys: Vec<F32Key>)
pub fn add_track(&mut self, shape_name: impl Into<String>, keys: Vec<F32Key>)
Add a weight track for a named blend shape.
Sourcepub fn evaluate(&self) -> HashMap<String, f32>
pub fn evaluate(&self) -> HashMap<String, f32>
Evaluate all tracks at current time and return a weight map.
Sourcepub fn weight_of(&self, shape_name: &str) -> f32
pub fn weight_of(&self, shape_name: &str) -> f32
Evaluate a single shape weight at current time.
Sourcepub fn track_count(&self) -> usize
pub fn track_count(&self) -> usize
Number of shape tracks.
Trait Implementations§
Source§impl Debug for BlendShapeAnimator
impl Debug for BlendShapeAnimator
Source§impl Default for BlendShapeAnimator
impl Default for BlendShapeAnimator
Source§fn default() -> BlendShapeAnimator
fn default() -> BlendShapeAnimator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BlendShapeAnimator
impl RefUnwindSafe for BlendShapeAnimator
impl Send for BlendShapeAnimator
impl Sync for BlendShapeAnimator
impl Unpin for BlendShapeAnimator
impl UnsafeUnpin for BlendShapeAnimator
impl UnwindSafe for BlendShapeAnimator
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.