Angel 3.2
A 2D Game Prototyping Engine

Simplifies lerping Actor properties across a timeframe. More...
#include <Interval.h>
Public Member Functions  
Interval (T start, T end, float duration, bool smooth=false)  
Interval ()  
T  Step (float dt) 
float  GetCurrent () 
bool  ShouldStep () 
This is a helper template class that manages Actor properties during lerp transitions. The following functions show how they are setup, and the Actor::Update function shows how to update and get the next values.
You can use Intervals for ints, floats, and any class that has defined subtraction and division (by a float) operators that return members of that same class. Our Color, Vector2, and Vector3 classes are all able to be used in Intervals.
Definition at line 51 of file Interval.h.

inline 
Setting up the interval requires a starting value, a target ending state, and how long it should take to get there.
start  The starting value 
end  The ending value 
duration  Length of the transition in seconds 
smooth  Whether to use a smooth interpolation with easein and easeout instead of a simple linear interpolation. 
Definition at line 65 of file Interval.h.
The default constructor just sets up an Interval that does nothing. It's here because some compilers want it.
Definition at line 80 of file Interval.h.

inline 
The step function processes the appropriate change and shuts the interval down if it's finished.
dt  How much time has elapsed since the last Step (so how much the Interval should be incremented) 
Definition at line 94 of file Interval.h.

inline 
Get the current value without Stepping the Interval
Definition at line 131 of file Interval.h.

inline 
Whether or not the Interval still has changes to process. If this returns false, the Interval is done and you can discard it.
Definition at line 142 of file Interval.h.