pub enum TrackValue {
Real(f32),
Vector2(Vector2<f32>),
Vector3(Vector3<f32>),
Vector4(Vector4<f32>),
UnitQuaternion(UnitQuaternion<f32>),
}Expand description
A real value that can be produced by an animation track. Animations always operate on real numbers (f32) for any kind
of machine numeric types (including bool). This is needed to be able to blend values; final blending result is then
converted to an actual machine type of a target property.
Variants§
Real(f32)
A real number.
Vector2(Vector2<f32>)
A 2-dimensional vector of real values.
Vector3(Vector3<f32>)
A 3-dimensional vector of real values.
Vector4(Vector4<f32>)
A 4-dimensional vector of real values.
UnitQuaternion(UnitQuaternion<f32>)
A quaternion that represents some rotation.
Implementations§
Source§impl TrackValue
impl TrackValue
Sourcepub fn blend_with(&mut self, other: &Self, weight: f32)
pub fn blend_with(&mut self, other: &Self, weight: f32)
Mixes (blends) the current value with an other value using the given weight. Blending is possible only if the types are the same.
Sourcepub fn apply_to_any(&self, any: &mut dyn Any, value_type: ValueType) -> bool
pub fn apply_to_any(&self, any: &mut dyn Any, value_type: ValueType) -> bool
Tries to perform a numeric type casting of the current value to some other and returns a boxed value, that can be used to set the value using reflection.
Trait Implementations§
Source§impl Clone for TrackValue
impl Clone for TrackValue
Source§fn clone(&self) -> TrackValue
fn clone(&self) -> TrackValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrackValue
impl Debug for TrackValue
Source§impl PartialEq for TrackValue
impl PartialEq for TrackValue
Source§fn eq(&self, other: &TrackValue) -> bool
fn eq(&self, other: &TrackValue) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TrackValue
Auto Trait Implementations§
impl Freeze for TrackValue
impl RefUnwindSafe for TrackValue
impl Send for TrackValue
impl Sync for TrackValue
impl Unpin for TrackValue
impl UnsafeUnpin for TrackValue
impl UnwindSafe for TrackValue
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.