Creates a 1D spring animator.
Spring constant (stiffness).
Damping coefficient.
Mass of the simulated value.
Damping constant (resistance).
Spring constant (stiffness).
Mass of the simulated value.
A callback that fires once when the spring settles at its target.
Current velocity of the simulated value.
StaticbouncyConvenience factory for a bouncy spring with noticeable overshoot.
Total perceptual duration in seconds (default: 0.5).
A SpringAnimate1D configured for bouncy motion.
Evaluates the new value based on the spring dynamics.
The current value.
The target value.
The updated value.
Checks if the spring has effectively come to rest at the target value.
The current simulated value.
The value the spring is moving towards.
How close the value needs to be to the target.
How low the velocity needs to be.
True if the spring is settled, false otherwise.
Resets the spring's velocity and time accumulator to zero.
Retunes this spring to match a desired duration and bounce. Preserves current velocity/accumulator by default to maintain continuity.
Perceptual duration in seconds.
Bounce factor in [0,1], default 0 (smooth/critically-damped).
If false, velocity/accumulator are reset.
Retunes to the bouncy profile.
Perceptual duration in seconds.
If false, resets velocity/accumulator.
Retunes to the smooth profile.
Perceptual duration in seconds.
If false, resets velocity/accumulator.
Retunes to the snappy profile.
Perceptual duration in seconds.
If false, resets velocity/accumulator.
StaticsmoothConvenience factory for a smooth, critically-damped spring with no bounce.
Total perceptual duration in seconds (default: 0.3).
A SpringAnimate1D configured for smooth motion.
StaticsnappyConvenience factory for a snappy spring with slight bounce.
Total perceptual duration in seconds (default: 0.3).
A SpringAnimate1D configured for snappy motion.
StaticspringCreates a new spring animation with the given duration and bounce.
The perceptual duration of the animation in seconds.
How much bounce the spring should have. 0 is no bounce.
A new 1D spring animation object.
A 1D spring simulation class for smooth, physically-based animations of numbers.