Skip to main content

Module procedural

Module procedural 

Source
Expand description

Ready-made procedural curves.

These are thin wrappers over crate::curve::KeyframeCurve::from_curve_fn that ship a handful of well-tuned non-easing shapes (spring, bounce, elastic, overshoot / “back”). Users who need something more custom can call crate::Curve::from_curve_fn / crate::Curve::from_motion_fn directly.

All functions return a fully validated crate::Curve; construction may fail with crate::CurveError if the parameters yield an unsafe curve (NaN, exploding values, …).

Functions§

bounce
Bouncing curve — several damped rebounds converging on 1.
elastic
Elastic ease-out — sinusoidal overshoot damped by 2^(-10t).
overshoot
Back / overshoot ease-in-out (Robert Penner’s “back” family).
spring
Damped-cosine “spring” curve.