29 #ifndef DOXYGEN_SHOULD_SKIP_THIS    45     using Setter = std::function<void(const T&)>;
    61     , m_duration(duration)
    79     , m_setter([&value](const 
T& newValue) { value = newValue; })
    81     , m_duration(duration)
   129       m_duration = duration;
   147       return gf::lerp(m_origin, m_target, m_easing(m_elapsed.asSeconds() / m_duration.asSeconds()));
   156       return m_elapsed >= m_duration;
   167       if (m_elapsed >= m_duration) {
   168         m_elapsed = m_duration;
   171       m_setter(getValue());
   190 #ifndef DOXYGEN_SHOULD_SKIP_THIS constexpr T lerp(T lhs, T rhs, U t)
Linear interpolation function. 
Definition: Math.h:242
 
void setOrigin(T origin)
Change the origin of the tween. 
Definition: Tween.h:92
 
Tween(T origin, T target, Setter setter, Time duration, Easing easing=Ease::linear)
Constructor with a setter. 
Definition: Tween.h:56
 
static constexpr Time zero()
Get a time of zero. 
Definition: Time.h:186
 
void restart()
Restart the tween. 
Definition: Tween.h:177
 
bool isFinished() const
Check if the tween is finished. 
Definition: Tween.h:155
 
Represents a time value. 
Definition: Time.h:74
 
void setDuration(Time duration)
Change the duration of the tween. 
Definition: Tween.h:128
 
constexpr T getOrigin() const noexcept
Get the origin of the tween. 
Definition: Tween.h:101
 
void setTarget(T target)
Change the target of the tween. 
Definition: Tween.h:110
 
The namespace for gf classes. 
Definition: Action.h:35
 
static float linear(float t)
Linear easing. 
 
constexpr T getTarget() const noexcept
Get the target of the tween. 
Definition: Tween.h:119
 
constexpr Time getDuration() const noexcept
Get the duration of the tween. 
Definition: Tween.h:137
 
Tween(T origin, T target, T &value, Time duration, Easing easing=Ease::linear)
Constructor with a reference. 
Definition: Tween.h:76
 
float(*)(float) Easing
An easing function. 
Definition: Easings.h:48
 
void update(Time time)
Update the tween. 
Definition: Tween.h:164
 
An interpolation between two values. 
Definition: Tween.h:40
 
std::function< void(const Vector< float, 4 > &)> Setter
A setter function. 
Definition: Tween.h:45
 
T getValue() const
Get the current value of the tween. 
Definition: Tween.h:146