7#include <PhosphorAnimation/phosphoranimation_export.h>
38 std::unique_ptr<Curve>
clone()
const override;
56 return !(*
this == other);
Polymorphic base for all animation curves.
Definition Curve.h:44
Damped harmonic oscillator.
Definition Spring.h:19
bool equals(const Curve &other) const override
Same typeId + same parameters.
std::unique_ptr< Curve > clone() const override
Deep copy with identical parameters.
bool operator==(const Spring &other) const
Spring & operator=(const Spring &)=default
Spring(qreal omega, qreal zeta)
QString typeId() const override
Stable identifier for this curve subclass (e.g. "bezier", "spring").
static Spring snappy()
Responsive, slight overshoot.
static Spring smooth()
Critically damped, no overshoot.
Spring(Spring &&)=default
Spring & operator=(Spring &&)=default
qreal settleTime() const override
Approximate settle time in seconds.
bool operator!=(const Spring &other) const
Definition Spring.h:54
static Spring fromString(const QString &str)
Parse from "spring:omega,zeta" or "omega,zeta". Clamps to valid ranges.
Spring(const Spring &)=default
static Spring bouncy()
Visible bounce.
qreal evaluate(qreal t) const override
Evaluate at normalized time t in [0,1]. May overshoot by design.
void step(qreal dt, CurveState &state, qreal target) const override
Advance state by dt real seconds toward target.
bool isStateful() const override
True if this curve requires persistent CurveState across frames.
Definition Spring.h:32
bool overshoots() const override
True for underdamped (zeta < 1). Critical/overdamped never overshoot.
QString toString() const override
Serialize to "typeId:params" or bare "x1,y1,x2,y2" for cubic-bezier.
Definition AnimatedValue.h:31
Mutable state for stateful curve progression (springs carry position+velocity across frames; stateles...
Definition Curve.h:19