pub struct DoubleBufferedSnapshot<S> { /* private fields */ }Expand description
Two-snapshot double buffer decoupling fixed-step simulation commits from high-refresh render interpolation.
Implementations§
Source§impl<S> DoubleBufferedSnapshot<S>where
S: Clone,
Construction, commit, discontinuity handling, and interpolation sampling for DoubleBufferedSnapshot.
impl<S> DoubleBufferedSnapshot<S>where
S: Clone,
Construction, commit, discontinuity handling, and interpolation sampling for DoubleBufferedSnapshot.
Sourcepub fn commit(&mut self, next: S)
pub fn commit(&mut self, next: S)
Commits a continuous fixed-step snapshot, promoting the prior curr_state into prev_state.
§Arguments
&Self- Mutable snapshot buffer.S- New immutable simulation state snapshot.
Sourcepub fn commit_discontinuous(&mut self, next: S)
pub fn commit_discontinuous(&mut self, next: S)
Commits a discontinuous snapshot (teleport, scene reset, or hard camera cut), preventing interpolation across the boundary.
§Arguments
&Self- Mutable snapshot buffer.S- New immutable simulation state snapshot.
Sourcepub fn sample(&self, alpha: f32) -> Swhere
S: InterpolatableState,
pub fn sample(&self, alpha: f32) -> Swhere
S: InterpolatableState,
Source§impl<S> DoubleBufferedSnapshot<S>
impl<S> DoubleBufferedSnapshot<S>
pub fn get_prev_state(&self) -> &S
pub fn get_mut_prev_state(&mut self) -> &mut S
pub fn set_prev_state(&mut self, val: S) -> &mut Self
pub fn get_curr_state(&self) -> &S
pub fn get_mut_curr_state(&mut self) -> &mut S
pub fn set_curr_state(&mut self, val: S) -> &mut Self
pub fn get_tick(&self) -> u64
pub fn get_mut_tick(&mut self) -> &mut u64
pub fn set_tick(&mut self, val: u64) -> &mut Self
pub fn get_discontinuity_tick(&self) -> u64
pub fn get_mut_discontinuity_tick(&mut self) -> &mut u64
pub fn set_discontinuity_tick(&mut self, val: u64) -> &mut Self
pub fn get_has_prev(&self) -> bool
pub fn get_mut_has_prev(&mut self) -> &mut bool
pub fn set_has_prev(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl<S: Clone> Clone for DoubleBufferedSnapshot<S>
impl<S: Clone> Clone for DoubleBufferedSnapshot<S>
Source§impl<S: Debug> Debug for DoubleBufferedSnapshot<S>
impl<S: Debug> Debug for DoubleBufferedSnapshot<S>
Source§impl<S: PartialEq> PartialEq for DoubleBufferedSnapshot<S>
impl<S: PartialEq> PartialEq for DoubleBufferedSnapshot<S>
impl<S: PartialEq> StructuralPartialEq for DoubleBufferedSnapshot<S>
Auto Trait Implementations§
impl<S> Forget for DoubleBufferedSnapshot<S>
impl<S> Freeze for DoubleBufferedSnapshot<S>where
S: Freeze,
impl<S> Move for DoubleBufferedSnapshot<S>
impl<S> RefUnwindSafe for DoubleBufferedSnapshot<S>where
S: RefUnwindSafe,
impl<S> Send for DoubleBufferedSnapshot<S>where
S: Send,
impl<S> Sync for DoubleBufferedSnapshot<S>where
S: Sync,
impl<S> Unpin for DoubleBufferedSnapshot<S>where
S: Unpin,
impl<S> UnsafeUnpin for DoubleBufferedSnapshot<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for DoubleBufferedSnapshot<S>where
S: UnwindSafe,
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