pub enum MotionModel {
Timeline(MotionSpec),
Spring(MotionSpringSpec),
}Expand description
Shared motion model wrapper for timeline and spring transitions.
Variants§
Timeline(MotionSpec)
Duration/easing timeline motion.
Spring(MotionSpringSpec)
Velocity-aware spring motion.
Implementations§
Source§impl MotionModel
impl MotionModel
Sourcepub const fn timeline(spec: MotionSpec) -> Self
pub const fn timeline(spec: MotionSpec) -> Self
Creates a timeline motion model.
Sourcepub const fn spring(spec: MotionSpringSpec) -> Self
pub const fn spring(spec: MotionSpringSpec) -> Self
Creates a spring motion model.
Sourcepub const fn preference(self) -> MotionPreference
pub const fn preference(self) -> MotionPreference
Returns the motion preference.
Sourcepub const fn is_immediate(self) -> bool
pub const fn is_immediate(self) -> bool
Returns whether this model completes immediately.
Sourcepub const fn sequence_duration_hint(self) -> Duration
pub const fn sequence_duration_hint(self) -> Duration
Returns the duration used when this model participates in a sequence plan.
Timeline models use their exact duration. Spring models use their review-duration hint, because physical completion is still determined by sampled rest state.
Sourcepub fn sample_scalar_elapsed(
self,
from: f32,
target: f32,
initial_velocity: f32,
elapsed: Duration,
) -> MotionScalarSample
pub fn sample_scalar_elapsed( self, from: f32, target: f32, initial_velocity: f32, elapsed: Duration, ) -> MotionScalarSample
Samples this motion model as a scalar value.
Trait Implementations§
Source§impl Clone for MotionModel
impl Clone for MotionModel
impl Copy for MotionModel
Source§impl Debug for MotionModel
impl Debug for MotionModel
Source§impl PartialEq for MotionModel
impl PartialEq for MotionModel
impl StructuralPartialEq for MotionModel
Auto Trait Implementations§
impl Freeze for MotionModel
impl RefUnwindSafe for MotionModel
impl Send for MotionModel
impl Sync for MotionModel
impl Unpin for MotionModel
impl UnsafeUnpin for MotionModel
impl UnwindSafe for MotionModel
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