pub struct AnimationController<T: Transform> { /* private fields */ }
Expand description
A runtime representation of an Animation State Machine, consisting of one or more AnimationStates connected by AnimationTransitions, where the output animation pose depends on the current state or any active transitions between states.
Implementations
sourceimpl<T: Transform> AnimationController<T>
impl<T: Transform> AnimationController<T>
sourcepub fn new(
controller_def: AnimationControllerDef,
skeleton: Rc<Skeleton>,
animations: &HashMap<ClipId, Rc<AnimationClip<T>>>
) -> AnimationController<T>
pub fn new(
controller_def: AnimationControllerDef,
skeleton: Rc<Skeleton>,
animations: &HashMap<ClipId, Rc<AnimationClip<T>>>
) -> AnimationController<T>
Create an AnimationController instance from its definition, the desired skeleton, and a collection of currently loaded animation clips.
sourcepub fn update(&mut self, delta_time: f64)
pub fn update(&mut self, delta_time: f64)
Update the controller’s local clock with the given time delta
sourcepub fn set_playback_speed(&mut self, speed: f64)
pub fn set_playback_speed(&mut self, speed: f64)
Set the playback speed for the controller
sourcepub fn set_param_value(&mut self, name: &str, value: f32)
pub fn set_param_value(&mut self, name: &str, value: f32)
Set the value for the given controller parameter
sourcepub fn get_param_value(&self, name: &str) -> f32
pub fn get_param_value(&self, name: &str) -> f32
Return the value for the given controller parameter
sourcepub fn get_parameters(&self) -> &HashMap<String, f32>
pub fn get_parameters(&self) -> &HashMap<String, f32>
Return a read-only reference to the controller parameter map
sourcepub fn get_output_pose<TOutput: Transform + FromTransform<T>>(
&mut self,
ext_dt: f64,
output_poses: &mut [TOutput]
)
pub fn get_output_pose<TOutput: Transform + FromTransform<T>>(
&mut self,
ext_dt: f64,
output_poses: &mut [TOutput]
)
Calculate global skeletal joint poses for the given time since last update
Auto Trait Implementations
impl<T> RefUnwindSafe for AnimationController<T>where
T: RefUnwindSafe,
impl<T> !Send for AnimationController<T>
impl<T> !Sync for AnimationController<T>
impl<T> Unpin for AnimationController<T>
impl<T> UnwindSafe for AnimationController<T>where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more