pub struct LiquidDynamics { /* private fields */ }Expand description
Per-lens frame integrator. Interior-mutable so per-frame draw closures
(plain Fn) can advance it without a RefCell dance.
Implementations§
Source§impl LiquidDynamics
impl LiquidDynamics
pub fn new(runtime: RuntimeHandle) -> Self
Sourcepub fn reset(&self)
pub fn reset(&self)
Forget all motion state (fresh grab, teleporting relayout): the next update re-anchors at rest.
Sourcepub fn update(&self, pos: (f32, f32)) -> LiquidPose
pub fn update(&self, pos: (f32, f32)) -> LiquidPose
Advance with the lens ride position using the runtime’s animation clock. Multiple reads within one frame return the same pose.
Sourcepub fn advance(&self, pos: (f32, f32), dt: f32) -> LiquidPose
pub fn advance(&self, pos: (f32, f32), dt: f32) -> LiquidPose
Pure integration step (exposed for tests and custom clocks): advance
by dt seconds toward pos.
Sourcepub fn pose(&self) -> LiquidPose
pub fn pose(&self) -> LiquidPose
Latest pose without advancing.
Auto Trait Implementations§
impl !Freeze for LiquidDynamics
impl !RefUnwindSafe for LiquidDynamics
impl !Send for LiquidDynamics
impl !Sync for LiquidDynamics
impl !UnwindSafe for LiquidDynamics
impl Unpin for LiquidDynamics
impl UnsafeUnpin for LiquidDynamics
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