RavEngine
Loading...
Searching...
No Matches
RavEngine::Tween< Floats > Class Template Reference

Public Member Functions

 Tween (const stepfunc &step, Floats ... initialValue)
 
 Tween (const Tween &other)
 
constexpr Tween & operator= (const Tween &other)
 
template<typename T >
constexpr Tween & AddKeyframe (decimalType time, T interpolation, Floats ... values)
 
constexpr void Step (decimalType scale)
 
constexpr void Seek (float pos)
 
constexpr float GetProgress () const
 

Protected Types

typedef Function< void(Floats...)> stepfunc
 

Protected Attributes

tweeny::tween< Floats... > anim
 

Constructor & Destructor Documentation

◆ Tween()

template<typename ... Floats>
RavEngine::Tween< Floats >::Tween ( const stepfunc &  step,
Floats ...  initialValue 
)
inline

Construct a Tween object

Parameters
stepthe function to invoke on each step.
intialValuethe starting value, set to 0 if not passed.

Member Function Documentation

◆ AddKeyframe()

template<typename ... Floats>
template<typename T >
constexpr Tween & RavEngine::Tween< Floats >::AddKeyframe ( decimalType  time,
T  interpolation,
Floats ...  values 
)
inlineconstexpr

Add a keyframe to the animation

Parameters
valuethe value for the keyframe
timethe time (in seconds) for this keyframe.
interpolationthe interpolation function to use

◆ Step()

template<typename ... Floats>
constexpr void RavEngine::Tween< Floats >::Step ( decimalType  scale)
inlineconstexpr

Perform one step of this animation. Note that adding more keys while an animation is playing will affect its playback

Parameters
scalethe timestep. Generally you want to simply pass the value from tick.

The documentation for this class was generated from the following file: