|
psychic-ui 0.0.0
|
#include <Timing.hpp>
Public Member Functions | |
| template<class Rep, class Period> | |
| constexpr | Timing (std::chrono::duration< Rep, Period > duration, Ease ease=Ease::Standard) |
| constexpr | Timing (Spring spring) |
| constexpr bool | instant () const |
| constexpr bool | isSpring () const |
| constexpr std::chrono::nanoseconds | duration () const |
| constexpr const Ease & | ease () const |
| constexpr const Spring & | spring () const |
| constexpr bool | keepsVelocity () const |
| Approach | approach (float offset0, float velocity0, float seconds, float tolerance) const |
| constexpr bool | operator== (const Timing &) const =default |
How a value moves to a new one: a duration along an easing curve, or a spring. The default timing, and a duration of 0, are instant.
Timing{150ms} // CSS's default curve
Timing{100ms, Ease::Out}
Timing{Spring::Snappy}
|
nodiscard |
Where a value moving with this timing is, seconds after it had an offset of offset0 from its target and a velocity of velocity0: along the curve (from rest, whatever the velocity) or pulled by the spring. tolerance is how close a spring settles (a curve settles when its duration is over).
|
inlinenodiscardconstexpr |
Whether values jump to their end: no duration and no spring
|
inlinenodiscardconstexpr |
Whether a retarget keeps the velocity: a spring does, a curve starts from rest