pub enum VelocityStrategy {
Regression,
RecentAverage([f32; 3]),
}Expand description
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
impl 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