pub enum VelocityStrategy {
Regression,
RecentAverage([f32; 3]),
}Expand description
The shared animation layer — physics, curves, driver — see
frus_core::animation. Re-exported here so applications can reach it through
frus_widgets without depending on frus-core directly.
How a VelocityTracker turns a history of positions into a velocity.
Variants§
Regression
A quadratic least-squares regression over the samples inside the horizon, with the velocity read off as the fit’s first-order coefficient. Sees acceleration; robust to a noisy or decelerating tail.
RecentAverage([f32; 3])
A weighted average of the last three sample-to-sample velocities, oldest first. Cheap, and deliberately biased towards the older samples — which is how the platforms that bounce read a fling.
Trait Implementations§
Source§impl Clone for VelocityStrategy
impl Clone for VelocityStrategy
Source§fn clone(&self) -> VelocityStrategy
fn clone(&self) -> VelocityStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for VelocityStrategy
Source§impl Debug for VelocityStrategy
impl Debug for VelocityStrategy
Source§impl PartialEq for VelocityStrategy
impl PartialEq for VelocityStrategy
impl StructuralPartialEq for VelocityStrategy
Auto Trait Implementations§
impl Freeze for VelocityStrategy
impl RefUnwindSafe for VelocityStrategy
impl Send for VelocityStrategy
impl Sync for VelocityStrategy
impl Unpin for VelocityStrategy
impl UnsafeUnpin for VelocityStrategy
impl UnwindSafe for VelocityStrategy
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