Struct SpringPresets
pub struct SpringPresets {
pub subtle: SpringParams,
pub snappy: SpringParams,
pub bouncy: SpringParams,
pub heavy: SpringParams,
pub tracking: SpringParams,
}Fields§
§subtle: SpringParamsGentle, no overshoot (ζ ≈ 1.0). Ambient settles.
snappy: SpringParamsQuick, barely-perceptible overshoot (ζ ≈ 0.87). Default for UI.
bouncy: SpringParamsPlayful overshoot (ζ ≈ 0.45). Reserved for deliberate bounce.
heavy: SpringParamsMass you can feel (ζ = 1.0, ω = 32 rad/s). For a control that is meant to read as a physical object rather than a state change.
Weight and bounce are opposites: overshoot reads light (a thing with very little inertia springs past and wobbles back), so this is critically damped — ζ = exactly 1.0, the boundary where overshoot disappears.
Weight does not come from a long settle: an earlier ω = 14 (~0.5s) tuning read as slow, not heavy — the control had visually arrived and was still creeping. Inertia is legible while you’re pushing (follow-lag, detent pull); once released it should land promptly, so the settle sits at ~0.26s.
tracking: SpringParamsStiff critical follow (ζ = 1.0, ω = 40 rad/s). For a surface that trails a dragging pointer instead of being welded to it.
A surface pinned exactly under the cursor reads weightless — mass can’t change velocity instantly, and routing the drag through a spring puts a lag between hand and surface proportional to speed, which is how inertia presents itself.
Tracking error of a critically damped spring at constant speed v
is 2v/ω, so ω sets the whole feel: too soft reads as late
rather than heavy. At ω = 40 an unhurried drag trails by a couple
of degrees, a hard yank by about half a detent.
Trait Implementations§
§impl Clone for SpringPresets
impl Clone for SpringPresets
§fn clone(&self) -> SpringPresets
fn clone(&self) -> SpringPresets
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SpringPresets
impl Debug for SpringPresets
§impl Default for SpringPresets
impl Default for SpringPresets
§fn default() -> SpringPresets
fn default() -> SpringPresets
§impl PartialEq for SpringPresets
impl PartialEq for SpringPresets
impl Copy for SpringPresets
impl StructuralPartialEq for SpringPresets
Auto Trait Implementations§
impl Freeze for SpringPresets
impl RefUnwindSafe for SpringPresets
impl Send for SpringPresets
impl Sync for SpringPresets
impl Unpin for SpringPresets
impl UnsafeUnpin for SpringPresets
impl UnwindSafe for SpringPresets
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more