#include "typedef.h" #include template < typename T > inline T lerp( T a, T b, F32 t ) { return a + ( b - a ) * t; } template < typename t > inline t clamp( t a, t min, t max ) { if ( a < min ) return min; if ( a > max ) return max; return a; } inline F32 ease_in( F32 t, F32 pow = 2.f ) { return powf( t, pow ); } inline F32 ease_out( F32 t, F32 pow = 2.f ) { return 1.f - powf( 1.f - t, pow ); } inline F32 ease_in_out( F32 t, F32 pow = 2.f ) { return t < 0.5f ? ease_in( t * 2.f, pow ) / 2.f : ease_out( t * 2.f - 1.f, pow ) / 2.f + 0.5f; }