pub struct MotionScalarController<K> { /* private fields */ }Expand description
A small keyed scalar motion controller.
Implementations§
Source§impl<K> MotionScalarController<K>
impl<K> MotionScalarController<K>
Sourcepub fn tracks(&self) -> &[(K, MotionScalarTrack)]
pub fn tracks(&self) -> &[(K, MotionScalarTrack)]
Returns all registered tracks in insertion order.
Source§impl<K: PartialEq> MotionScalarController<K>
impl<K: PartialEq> MotionScalarController<K>
Sourcepub fn start(
&mut self,
key: K,
model: MotionModel,
from: f32,
target: f32,
initial_velocity: f32,
started_at: Duration,
)
pub fn start( &mut self, key: K, model: MotionModel, from: f32, target: f32, initial_velocity: f32, started_at: Duration, )
Starts or replaces a keyed scalar track.
Sourcepub fn set_immediate(&mut self, key: K, value: f32, now: Duration)
pub fn set_immediate(&mut self, key: K, value: f32, now: Duration)
Sets or replaces a keyed scalar track with an immediate fixed value.
Sourcepub fn retarget(
&mut self,
key: K,
model: MotionModel,
target: f32,
now: Duration,
)
pub fn retarget( &mut self, key: K, model: MotionModel, target: f32, now: Duration, )
Retargets an existing keyed track from its sampled value and velocity.
Sourcepub fn cancel(&mut self, key: &K, now: Duration)
pub fn cancel(&mut self, key: &K, now: Duration)
Cancels an existing keyed track at the provided controller time.
Sourcepub fn finish(&mut self, key: &K, now: Duration)
pub fn finish(&mut self, key: &K, now: Duration)
Finishes an existing keyed 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 the frame demand at the provided controller time.
Source§impl<K> MotionScalarController<K>
impl<K> MotionScalarController<K>
Sourcepub fn prune_terminal_at(&mut self, now: Duration) -> usize
pub fn prune_terminal_at(&mut self, now: Duration) -> usize
Removes terminal tracks and returns the number of pruned entries.
Source§impl<K: Clone> MotionScalarController<K>
impl<K: Clone> MotionScalarController<K>
Sourcepub fn sample_at(&self, now: Duration) -> MotionScalarControllerSample<K>
pub fn sample_at(&self, now: Duration) -> MotionScalarControllerSample<K>
Samples all tracks at the provided controller time.
Sourcepub fn sample_clock(
&self,
clock: MotionClockSample,
) -> MotionScalarControllerSample<K>
pub fn sample_clock( &self, clock: MotionClockSample, ) -> MotionScalarControllerSample<K>
Samples all tracks at a deterministic adapter clock sample.
Sourcepub fn sample_since(
&self,
started_at: Instant,
now: Instant,
) -> MotionScalarControllerSample<K>
pub fn sample_since( &self, started_at: Instant, now: Instant, ) -> MotionScalarControllerSample<K>
Samples all tracks from adapter instants while keeping deterministic elapsed-time semantics in the controller layer.
Trait Implementations§
Source§impl<K: Clone> Clone for MotionScalarController<K>
impl<K: Clone> Clone for MotionScalarController<K>
Source§impl<K: Debug> Debug for MotionScalarController<K>
impl<K: Debug> Debug for MotionScalarController<K>
Source§impl<K> Default for MotionScalarController<K>
impl<K> Default for MotionScalarController<K>
Source§impl<K: PartialEq> PartialEq for MotionScalarController<K>
impl<K: PartialEq> PartialEq for MotionScalarController<K>
impl<K: PartialEq> StructuralPartialEq for MotionScalarController<K>
Auto Trait Implementations§
impl<K> Freeze for MotionScalarController<K>
impl<K> RefUnwindSafe for MotionScalarController<K>
impl<K> Send for MotionScalarController<K>
impl<K> Sync for MotionScalarController<K>
impl<K> Unpin for MotionScalarController<K>
impl<K> UnsafeUnpin for MotionScalarController<K>
impl<K> UnwindSafe for MotionScalarController<K>
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