Skip to main content

Motion

Struct Motion 

Source
pub struct Motion { /* private fields */ }
Expand description

Retains only properties referenced during the current frame, up to capacity. Targets are normalized [0,1] effects, not arbitrary geometry.

Implementations§

Source§

impl Motion

Source

pub fn new(capacity: usize) -> Self

Source

pub fn begin(&mut self, time: f64, preference: MotionPreference)

Source

pub fn effect( &mut self, id: u64, property: u8, target: f32, initial: f32, spring: Spring, ) -> f32

First encounter initializes at initial; use target for no entrance effect. Retargeting preserves the sampled presentation and velocity.

Source

pub fn tween( &mut self, id: u64, property: u8, target: f32, initial: f32, enter: TweenSpec, exit: TweenSpec, ) -> f32

Source

pub fn elapsed(&mut self, id: u64, property: u8) -> f64

Source

pub fn pause_clocks(&mut self)

Source

pub fn finish(&mut self)

Source

pub fn is_animating(&self) -> bool

Source

pub fn retained_properties(&self) -> usize

Trait Implementations§

Source§

impl Default for Motion

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Motion

§

impl Freeze for Motion
where *const u8 is !null: Freeze, PhantomData<((u64, u8), Track)>: Freeze, PhantomData<((u64, u8), (Tween, u64))>: Freeze, PhantomData<((u64, u8), (f64, u64))>: Freeze,

§

impl Move for Motion

§

impl RefUnwindSafe for Motion

§

impl Send for Motion
where RawTable<((u64, u8), Track)>: Send, RawTable<((u64, u8), (Tween, u64))>: Send, RawTable<((u64, u8), (f64, u64))>: Send,

§

impl Sync for Motion
where RawTable<((u64, u8), Track)>: Sync, RawTable<((u64, u8), (Tween, u64))>: Sync, RawTable<((u64, u8), (f64, u64))>: Sync,

§

impl Unpin for Motion
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Motion

§

impl UnwindSafe for Motion
where HashMap<(u64, u8), Track>: UnwindSafe, HashMap<(u64, u8), (Tween, u64)>: UnwindSafe, HashMap<(u64, u8), (f64, u64)>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.