pub struct MotionClockSample { /* private fields */ }Expand description
Adapter clock sample mapped into deterministic controller elapsed time.
Implementations§
Source§impl MotionClockSample
impl MotionClockSample
Sourcepub fn from_elapsed(
previous_elapsed: Duration,
requested_elapsed: Duration,
) -> Self
pub fn from_elapsed( previous_elapsed: Duration, requested_elapsed: Duration, ) -> Self
Creates a clock sample from previous and requested elapsed times.
Non-monotonic elapsed time is clamped to the previous elapsed time. This keeps controller sampling deterministic and avoids negative deltas for adapters whose frame clock moves backwards or is restored from stale state.
Sourcepub fn from_instant(started_at: Instant, now: Instant) -> Self
pub fn from_instant(started_at: Instant, now: Instant) -> Self
Creates a clock sample from a start instant and current adapter instant.
Sourcepub fn from_instants(
started_at: Instant,
previous_now: Instant,
now: Instant,
) -> Self
pub fn from_instants( started_at: Instant, previous_now: Instant, now: Instant, ) -> Self
Creates a clock sample from adapter instants and clamps non-monotonic elapsed time.
Trait Implementations§
Source§impl Clone for MotionClockSample
impl Clone for MotionClockSample
impl Copy for MotionClockSample
Source§impl Debug for MotionClockSample
impl Debug for MotionClockSample
impl Eq for MotionClockSample
Source§impl PartialEq for MotionClockSample
impl PartialEq for MotionClockSample
impl StructuralPartialEq for MotionClockSample
Auto Trait Implementations§
impl Freeze for MotionClockSample
impl RefUnwindSafe for MotionClockSample
impl Send for MotionClockSample
impl Sync for MotionClockSample
impl Unpin for MotionClockSample
impl UnsafeUnpin for MotionClockSample
impl UnwindSafe for MotionClockSample
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