template<typename T> asge::math::Tween
Moves a value of type T (a float, a Float2, ...) from one value to another over a duration, shaped by an Easing.
#include <Tween.hpp>Advance it with Update(), read it with Value(); it does not loop and holds no callbacks poll IsFinished() or Update()'s result.
Private Attributes
Public Member Functions
#
Tween(T inFrom, T inTo, float inDuration, Easing inEasing=Easing::Linear) noexceptA tween from inFrom to inTo lasting inDuration seconds; a duration of 0 or less is finished at once.
#
bool Update(float inDeltaTime) noexceptAdvances by inDeltaTime seconds, stopping at the end; returns true only on the call that finishes it.
#
T Value() const noexceptThe eased value at the current time: the start before any Update, the end once finished.
#
bool IsFinished() const noexceptTrue once the full duration has elapsed (immediately, for a duration of 0 or less).
#
void Reset() noexceptRewinds to the start so the tween can play again.