pub struct InertiaConfig<T = f32> {
pub friction: f32,
pub min_velocity: f32,
pub bounds: Option<InertiaBounds<T>>,
}Expand description
Configuration for friction inertia.
friction is a constant deceleration in units per second squared.
min_velocity is the absolute velocity threshold below which inertia is
considered settled.
Fields§
§friction: f32Constant deceleration in units per second squared.
min_velocity: f32Velocity threshold below which the inertia settles.
bounds: Option<InertiaBounds<T>>Optional inclusive bounds for the position.
Implementations§
Source§impl<T> InertiaConfig<T>
impl<T> InertiaConfig<T>
Sourcepub fn with_bounds(self, bounds: InertiaBounds<T>) -> Self
pub fn with_bounds(self, bounds: InertiaBounds<T>) -> Self
Attach inclusive position bounds.
Source§impl InertiaConfig<f32>
impl InertiaConfig<f32>
Trait Implementations§
Source§impl<T: Clone> Clone for InertiaConfig<T>
impl<T: Clone> Clone for InertiaConfig<T>
Source§fn clone(&self) -> InertiaConfig<T>
fn clone(&self) -> InertiaConfig<T>
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 moreSource§impl<T: Debug> Debug for InertiaConfig<T>
impl<T: Debug> Debug for InertiaConfig<T>
Source§impl Default for InertiaConfig<f32>
impl Default for InertiaConfig<f32>
Source§impl<T: PartialEq> PartialEq for InertiaConfig<T>
impl<T: PartialEq> PartialEq for InertiaConfig<T>
Source§fn eq(&self, other: &InertiaConfig<T>) -> bool
fn eq(&self, other: &InertiaConfig<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T> StructuralPartialEq for InertiaConfig<T>
Auto Trait Implementations§
impl<T> Freeze for InertiaConfig<T>where
T: Freeze,
impl<T> RefUnwindSafe for InertiaConfig<T>where
T: RefUnwindSafe,
impl<T> Send for InertiaConfig<T>where
T: Send,
impl<T> Sync for InertiaConfig<T>where
T: Sync,
impl<T> Unpin for InertiaConfig<T>where
T: Unpin,
impl<T> UnsafeUnpin for InertiaConfig<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for InertiaConfig<T>where
T: 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