pub struct MotionScalarTrack { /* private fields */ }Expand description
One scalar motion track sampled by deterministic elapsed time.
Implementations§
Source§impl MotionScalarTrack
impl MotionScalarTrack
Sourcepub fn start(
model: MotionModel,
from: f32,
target: f32,
initial_velocity: f32,
started_at: Duration,
) -> Self
pub fn start( model: MotionModel, from: f32, target: f32, initial_velocity: f32, started_at: Duration, ) -> Self
Starts a scalar track at the provided controller time.
Sourcepub fn immediate(value: f32, started_at: Duration) -> Self
pub fn immediate(value: f32, started_at: Duration) -> Self
Creates an immediate scalar track at a fixed value.
Sourcepub const fn model(&self) -> MotionModel
pub const fn model(&self) -> MotionModel
Returns the motion model.
Sourcepub const fn initial_velocity(&self) -> f32
pub const fn initial_velocity(&self) -> f32
Returns the initial velocity.
Sourcepub const fn started_at(&self) -> Duration
pub const fn started_at(&self) -> Duration
Returns the controller time at which the track started.
Sourcepub const fn cancelled_at(&self) -> Option<Duration>
pub const fn cancelled_at(&self) -> Option<Duration>
Returns the controller time at which the track was cancelled.
Sourcepub const fn finished_at(&self) -> Option<Duration>
pub const fn finished_at(&self) -> Option<Duration>
Returns the controller time at which the track was explicitly finished.
Sourcepub fn cancel_at(&mut self, cancelled_at: Duration)
pub fn cancel_at(&mut self, cancelled_at: Duration)
Cancels the track at the provided controller time.
Sourcepub fn finish_at(&mut self, finished_at: Duration)
pub fn finish_at(&mut self, finished_at: Duration)
Finishes the track at the provided controller time and publishes the target value.
Sourcepub fn retarget(&self, model: MotionModel, target: f32, now: Duration) -> Self
pub fn retarget(&self, model: MotionModel, target: f32, now: Duration) -> Self
Retargets the track from its sampled value and velocity.
Sourcepub fn sample_at(&self, now: Duration) -> MotionScalarSample
pub fn sample_at(&self, now: Duration) -> MotionScalarSample
Samples the track at the provided controller time.
Sourcepub fn frame_demand_at(&self, now: Duration) -> MotionFrameDemand
pub fn frame_demand_at(&self, now: Duration) -> MotionFrameDemand
Returns whether this track needs another adapter-owned frame.
Trait Implementations§
Source§impl Clone for MotionScalarTrack
impl Clone for MotionScalarTrack
Source§impl Debug for MotionScalarTrack
impl Debug for MotionScalarTrack
Source§impl PartialEq for MotionScalarTrack
impl PartialEq for MotionScalarTrack
impl StructuralPartialEq for MotionScalarTrack
Auto Trait Implementations§
impl Freeze for MotionScalarTrack
impl RefUnwindSafe for MotionScalarTrack
impl Send for MotionScalarTrack
impl Sync for MotionScalarTrack
impl Unpin for MotionScalarTrack
impl UnsafeUnpin for MotionScalarTrack
impl UnwindSafe for MotionScalarTrack
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