Skylicht Engine
Loading...
Searching...
No Matches
Tween Directory Reference

Files

 
CTween.h
 
CTweenColor.h
 
CTweenFloat.h
 
CTweenManager.h
 
CTweenMatrix4.h
 
CTweenQuaternion.h
 
CTweenVector2df.h
 
CTweenVector3df.h
 
easing.h

Detailed Description

30 easing functions implemented in C++.

More info how functions look like and their behaviour on easings.net.

How to use

Include h-file.

    #include "easing.h"

After that there are two ways:

  1. Just call one of the 30 implemented functions:
     easeInSine( 0.5 );
    
  1. Or to make functions calls more unified, you can use the help-function (getEasingFunction) to get the pointer to the needed function and call it:
     auto easingFunction = getEasingFunction( EaseInExpo );
     double progress = easingFunction( 0.5 ); // 0.058
    
     easingFunction = getEasingFunction( EaseOutQuint );
     progress = easingFunction( 0.5 ); //0.968
    

Function that returns needed pointer has the following definition:

typedef double(*easingFunction)(double); easingFunction getEasingFunction( easing_functions function );

And accept one the enums:

enum easing_functions
{
 EaseInSine,
 EaseOutSine,
 EaseInOutSine,
 EaseInQuad,
 EaseOutQuad,
 EaseInOutQuad,
 EaseInCubic,
 EaseOutCubic,
 EaseInOutCubic,
 EaseInQuart,
 EaseOutQuart,
 EaseInOutQuart,
 EaseInQuint,
 EaseOutQuint,
 EaseInOutQuint,
 EaseInExpo,
 EaseOutExpo,
 EaseInOutExpo,
 EaseInCirc,
 EaseOutCirc,
 EaseInOutCirc,
 EaseInBack,
 EaseOutBack,
 EaseInOutBack,
 EaseInElastic,
 EaseOutElastic,
 EaseInOutElastic,
 EaseInBounce,
 EaseOutBounce,
 EaseInOutBounce
};