pub struct VelocityEstimate {
pub velocity: Velocity,
pub confidence: f32,
pub duration: f32,
pub offset: (f32, f32),
}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.
A velocity, with what the tracker knows about how much to trust it.
Fields§
§velocity: VelocityThe estimated speed at the last sample, in px/s.
confidence: f32How much of the samples’ variance the fit explains, in 0..=1 (an
r-squared). 1.0 for the strategies that do not fit anything.
duration: f32The time the samples used span, in seconds.
offset: (f32, f32)The total displacement over those samples, in px. A gesture that was fast but covered no ground is a twitch, not a fling — which is why this travels with the velocity.
Implementations§
Source§impl VelocityEstimate
impl VelocityEstimate
Sourcepub const STILL: VelocityEstimate
pub const STILL: VelocityEstimate
An estimate that says “not moving”, with nothing to doubt about it.
Trait Implementations§
Source§impl Clone for VelocityEstimate
impl Clone for VelocityEstimate
Source§fn clone(&self) -> VelocityEstimate
fn clone(&self) -> VelocityEstimate
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 VelocityEstimate
Source§impl Debug for VelocityEstimate
impl Debug for VelocityEstimate
Source§impl PartialEq for VelocityEstimate
impl PartialEq for VelocityEstimate
impl StructuralPartialEq for VelocityEstimate
Auto Trait Implementations§
impl Freeze for VelocityEstimate
impl RefUnwindSafe for VelocityEstimate
impl Send for VelocityEstimate
impl Sync for VelocityEstimate
impl Unpin for VelocityEstimate
impl UnsafeUnpin for VelocityEstimate
impl UnwindSafe for VelocityEstimate
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