|
| | Easing ()=default |
| | Easing (const Easing &)=default |
| Easing & | operator= (const Easing &)=default |
| | Easing (Easing &&)=default |
| Easing & | operator= (Easing &&)=default |
| QString | typeId () const override |
| | Stable identifier for this curve subclass (e.g. "bezier", "spring").
|
| qreal | evaluate (qreal x) const override |
| | Evaluate at normalized time t in [0,1]. May overshoot by design.
|
| QString | toString () const override |
| | Serialize to "typeId:params" or bare "x1,y1,x2,y2" for cubic-bezier.
|
| std::unique_ptr< Curve > | clone () const override |
| | Deep copy with identical parameters.
|
| bool | overshoots () const override |
| | True if this curve may evaluate outside [0,1] during progression.
|
| bool | equals (const Curve &other) const override |
| | Same typeId + same parameters.
|
| bool | operator== (const Easing &other) const |
| bool | operator!= (const Easing &other) const |
| virtual | ~Curve ()=default |
| virtual void | step (qreal dt, CurveState &state, qreal target) const |
| | Advance state by dt real seconds toward target.
|
| virtual bool | isStateful () const |
| | True if this curve requires persistent CurveState across frames.
|
| virtual qreal | settleTime () const |
| | Approximate settle time in seconds.
|
|
| static std::optional< Easing > | tryParse (const QString &str) |
| | Parse from config string.
|
| static Easing | fromString (const QString &str) |
| | tryParse, or the default OutCubic when str is malformed.
|
| static qreal | minElasticPeak (qreal period) |
| | The gentlest bounce elastic can make at period — the low end of the overshoot range, and it MOVES with the period.
|
| static qreal | clampAmplitude (Type t, qreal amp, qreal period) |
| | Clamp amp to the range the given curve type actually honours.
|
Parametric easing curve: cubic bezier, elastic, or bounce.
All stateless. Default construction yields OutCubic bezier (0.33, 1.00, 0.68, 1.00). Value type with public fields — can be stack-allocated or stored inline.
| qreal PhosphorAnimation::Easing::minElasticPeak |
( |
qreal | period | ) |
|
|
static |
The gentlest bounce elastic can make at period — the low end of the overshoot range, and it MOVES with the period.
The curve is pinned to 0 at t = 0, a full unit below the target, so its wave cannot start with a magnitude below 1. At a short period the crest arrives before the envelope has decayed, so that unavoidable magnitude still shows up as a big first bounce: about 1.71 at period 0.1, versus 1.05 at period 1.0. Callers surface this as the slider's minimum instead of clamping into it silently, because a range that lies about what it can reach is how the old amplitude parameter went wrong in the first place.
| qreal PhosphorAnimation::Easing::amplitude = 1.0 |
Elastic: the PEAK VALUE the curve reaches, so 1.5 means it travels 50% past its target before settling back.
Range [minElasticPeak(period), 2.0].
This is deliberately not the classic Penner amplitude, which is the wave's magnitude at t = 0 — a quantity the curve never actually displays, because it is pinned to 0 there. Under that parameterisation the overshoot you SAW was the amplitude decayed by however long the crest took to arrive, so it moved with the period: one amplitude spanned a 5x range of real overshoot depending on where the period slider sat. The parameter now means the thing the user is actually choosing, and the internal Penner gain is solved for (solveElasticGain).
Bounce: height scale, [0.5, 3.0] — unrelated meaning, see clampAmplitude.
| qreal PhosphorAnimation::Easing::MaxElasticPeak = 2.0 |
|
staticconstexpr |
Highest peak an elastic curve may reach.
It is Limits::MaxCurveProgress, and the equality is the point: because amplitude IS the peak, capping it here makes the overshoot envelope EXACT for elastic rather than a bound the curve gets clipped against. Elastic-out tops out at exactly 2.0 and elastic-in, its mirror, bottoms out at exactly -1.0, so the two of them span the envelope precisely and nothing is ever clipped.