Struct amethyst_animation::AnimationControlSet [−][src]
pub struct AnimationControlSet<I, T> where
T: AnimationSampling, { pub animations: Vec<(I, AnimationControl<T>)>, // some fields omitted }
Contains all currently running animations for an entity.
Have support for running multiple animations, will do linear blending between all active animations. The target component specifies if it can be blended, if it can't, the last added animation wins.
Type parameters:
I
: identifier type for running animations, only one animation can be run at the same time with the same idT
: the component type that the animation should be applied to
Fields
animations: Vec<(I, AnimationControl<T>)>
Methods
impl<I, T> AnimationControlSet<I, T> where
I: PartialEq,
T: AnimationSampling,
[src]
impl<I, T> AnimationControlSet<I, T> where
I: PartialEq,
T: AnimationSampling,
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Is the animation set empty?
pub fn remove(&mut self, id: I)
[src]
pub fn remove(&mut self, id: I)
Remove animation from set
This should be used with care, as this will leave all linked samplers in place. If in
doubt, use abort()
instead.
pub fn start(&mut self, id: I)
[src]
pub fn start(&mut self, id: I)
Start animation if it exists
pub fn pause(&mut self, id: I)
[src]
pub fn pause(&mut self, id: I)
Pause animation if it exists
pub fn toggle(&mut self, id: I)
[src]
pub fn toggle(&mut self, id: I)
Toggle animation if it exists
pub fn set_rate(&mut self, id: I, rate_multiplier: f32)
[src]
pub fn set_rate(&mut self, id: I, rate_multiplier: f32)
Set animation rate
pub fn step(&mut self, id: I, direction: StepDirection)
[src]
pub fn step(&mut self, id: I, direction: StepDirection)
Step animation
pub fn set_input(&mut self, id: I, input: f32)
[src]
pub fn set_input(&mut self, id: I, input: f32)
Set animation input value (point of interpolation)
pub fn set_blend_weight(
&mut self,
id: I,
weights: Vec<(usize, T::Channel, f32)>
)
[src]
pub fn set_blend_weight(
&mut self,
id: I,
weights: Vec<(usize, T::Channel, f32)>
)
Set blend weights
pub fn abort(&mut self, id: I)
[src]
pub fn abort(&mut self, id: I)
Abort animation
pub fn add_animation(
&mut self,
id: I,
animation: &Handle<Animation<T>>,
end: EndControl,
rate_multiplier: f32,
command: AnimationCommand<T>
)
[src]
pub fn add_animation(
&mut self,
id: I,
animation: &Handle<Animation<T>>,
end: EndControl,
rate_multiplier: f32,
command: AnimationCommand<T>
)
Add animation with the given id, unless it already exists
pub fn add_deferred_animation(
&mut self,
id: I,
animation: &Handle<Animation<T>>,
end: EndControl,
rate_multiplier: f32,
command: AnimationCommand<T>,
wait_for: I,
wait_deferred_for: DeferStartRelation
)
[src]
pub fn add_deferred_animation(
&mut self,
id: I,
animation: &Handle<Animation<T>>,
end: EndControl,
rate_multiplier: f32,
command: AnimationCommand<T>,
wait_for: I,
wait_deferred_for: DeferStartRelation
)
Add deferred animation with the given id, unless it already exists
pub fn insert(&mut self, id: I, control: AnimationControl<T>)
[src]
pub fn insert(&mut self, id: I, control: AnimationControl<T>)
Insert an animation directly
pub fn has_animation(&mut self, id: I) -> bool
[src]
pub fn has_animation(&mut self, id: I) -> bool
Check if there is an animation with the given id in the set
Trait Implementations
impl<I: Clone, T: Clone> Clone for AnimationControlSet<I, T> where
T: AnimationSampling,
[src]
impl<I: Clone, T: Clone> Clone for AnimationControlSet<I, T> where
T: AnimationSampling,
fn clone(&self) -> AnimationControlSet<I, T>
[src]
fn clone(&self) -> AnimationControlSet<I, T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<I: Debug, T: Debug> Debug for AnimationControlSet<I, T> where
T: AnimationSampling,
[src]
impl<I: Debug, T: Debug> Debug for AnimationControlSet<I, T> where
T: AnimationSampling,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<I, T> Default for AnimationControlSet<I, T> where
T: AnimationSampling,
[src]
impl<I, T> Default for AnimationControlSet<I, T> where
T: AnimationSampling,
impl<I, T> Component for AnimationControlSet<I, T> where
I: Send + Sync + 'static,
T: AnimationSampling,
[src]
impl<I, T> Component for AnimationControlSet<I, T> where
I: Send + Sync + 'static,
T: AnimationSampling,
type Storage = DenseVecStorage<Self>
Associated storage type for this component.
Auto Trait Implementations
impl<I, T> Send for AnimationControlSet<I, T> where
I: Send,
<T as AnimationSampling>::Channel: Send,
<T as AnimationSampling>::Primitive: Send,
impl<I, T> Send for AnimationControlSet<I, T> where
I: Send,
<T as AnimationSampling>::Channel: Send,
<T as AnimationSampling>::Primitive: Send,
impl<I, T> Sync for AnimationControlSet<I, T> where
I: Sync,
<T as AnimationSampling>::Channel: Sync,
<T as AnimationSampling>::Primitive: Sync,
impl<I, T> Sync for AnimationControlSet<I, T> where
I: Sync,
<T as AnimationSampling>::Channel: Sync,
<T as AnimationSampling>::Primitive: Sync,