FlukyEngine
easing.hpp
Go to the documentation of this file.
1 
17 #pragma once
18 
19 // Dependency:
20 #include "../glm.hpp"
21 #include "../gtc/constants.hpp"
22 #include "../detail/qualifier.hpp"
23 
24 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
25 # ifndef GLM_ENABLE_EXPERIMENTAL
26 # pragma message("GLM: GLM_GTX_easing is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.")
27 # else
28 # pragma message("GLM: GLM_GTX_easing extension included")
29 # endif
30 #endif
31 
32 namespace glm{
35 
38  template <typename genType>
39  GLM_FUNC_DECL genType linearInterpolation(genType const & a);
40 
43  template <typename genType>
44  GLM_FUNC_DECL genType quadraticEaseIn(genType const & a);
45 
48  template <typename genType>
49  GLM_FUNC_DECL genType quadraticEaseOut(genType const & a);
50 
55  template <typename genType>
56  GLM_FUNC_DECL genType quadraticEaseInOut(genType const & a);
57 
59  template <typename genType>
60  GLM_FUNC_DECL genType cubicEaseIn(genType const & a);
61 
64  template <typename genType>
65  GLM_FUNC_DECL genType cubicEaseOut(genType const & a);
66 
71  template <typename genType>
72  GLM_FUNC_DECL genType cubicEaseInOut(genType const & a);
73 
76  template <typename genType>
77  GLM_FUNC_DECL genType quarticEaseIn(genType const & a);
78 
81  template <typename genType>
82  GLM_FUNC_DECL genType quarticEaseOut(genType const & a);
83 
88  template <typename genType>
89  GLM_FUNC_DECL genType quarticEaseInOut(genType const & a);
90 
93  template <typename genType>
94  GLM_FUNC_DECL genType quinticEaseIn(genType const & a);
95 
98  template <typename genType>
99  GLM_FUNC_DECL genType quinticEaseOut(genType const & a);
100 
105  template <typename genType>
106  GLM_FUNC_DECL genType quinticEaseInOut(genType const & a);
107 
110  template <typename genType>
111  GLM_FUNC_DECL genType sineEaseIn(genType const & a);
112 
115  template <typename genType>
116  GLM_FUNC_DECL genType sineEaseOut(genType const & a);
117 
120  template <typename genType>
121  GLM_FUNC_DECL genType sineEaseInOut(genType const & a);
122 
125  template <typename genType>
126  GLM_FUNC_DECL genType circularEaseIn(genType const & a);
127 
130  template <typename genType>
131  GLM_FUNC_DECL genType circularEaseOut(genType const & a);
132 
137  template <typename genType>
138  GLM_FUNC_DECL genType circularEaseInOut(genType const & a);
139 
142  template <typename genType>
143  GLM_FUNC_DECL genType exponentialEaseIn(genType const & a);
144 
147  template <typename genType>
148  GLM_FUNC_DECL genType exponentialEaseOut(genType const & a);
149 
154  template <typename genType>
155  GLM_FUNC_DECL genType exponentialEaseInOut(genType const & a);
156 
159  template <typename genType>
160  GLM_FUNC_DECL genType elasticEaseIn(genType const & a);
161 
164  template <typename genType>
165  GLM_FUNC_DECL genType elasticEaseOut(genType const & a);
166 
171  template <typename genType>
172  GLM_FUNC_DECL genType elasticEaseInOut(genType const & a);
173 
175  template <typename genType>
176  GLM_FUNC_DECL genType backEaseIn(genType const& a);
177 
179  template <typename genType>
180  GLM_FUNC_DECL genType backEaseOut(genType const& a);
181 
183  template <typename genType>
184  GLM_FUNC_DECL genType backEaseInOut(genType const& a);
185 
189  template <typename genType>
190  GLM_FUNC_DECL genType backEaseIn(genType const& a, genType const& o);
191 
195  template <typename genType>
196  GLM_FUNC_DECL genType backEaseOut(genType const& a, genType const& o);
197 
201  template <typename genType>
202  GLM_FUNC_DECL genType backEaseInOut(genType const& a, genType const& o);
203 
205  template <typename genType>
206  GLM_FUNC_DECL genType bounceEaseIn(genType const& a);
207 
209  template <typename genType>
210  GLM_FUNC_DECL genType bounceEaseOut(genType const& a);
211 
213  template <typename genType>
214  GLM_FUNC_DECL genType bounceEaseInOut(genType const& a);
215 
217 }//namespace glm
218 
219 #include "easing.inl"
GLM_FUNC_DECL genType elasticEaseOut(genType const &a)
Modelled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2, -10x) + 1.
Definition: easing.inl:295
GLM_FUNC_DECL genType sineEaseOut(genType const &a)
Modelled after quarter-cycle of sine wave (different phase)
Definition: easing.inl:182
GLM_FUNC_DECL genType quadraticEaseIn(genType const &a)
Modelled after the parabola y = x^2.
Definition: easing.inl:18
GLM_FUNC_DECL genType circularEaseInOut(genType const &a)
Modelled after the piecewise circular function y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5) y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1].
Definition: easing.inl:222
GLM_FUNC_DECL genType quarticEaseIn(genType const &a)
Modelled after the quartic x^4.
Definition: easing.inl:94
GLM_FUNC_DECL genType cubicEaseIn(genType const &a)
Modelled after the cubic y = x^3.
Definition: easing.inl:55
GLM_FUNC_DECL genType quinticEaseIn(genType const &a)
Modelled after the quintic y = x^5.
Definition: easing.inl:133
GLM_FUNC_DECL genType circularEaseIn(genType const &a)
Modelled after shifted quadrant IV of unit circle.
Definition: easing.inl:202
GLM_FUNC_DECL genType cubicEaseOut(genType const &a)
Modelled after the cubic y = (x - 1)^3 + 1.
Definition: easing.inl:65
GLM_FUNC_DECL genType backEaseOut(genType const &a)
Definition: easing.inl:373
Core features
Definition: common.hpp:20
GLM_FUNC_DECL genType backEaseInOut(genType const &a)
Definition: easing.inl:379
GLM_FUNC_DECL genType exponentialEaseIn(genType const &a)
Modelled after the exponential function y = 2^(10(x - 1))
Definition: easing.inl:239
GLM_FUNC_DECL genType quinticEaseInOut(genType const &a)
Modelled after the piecewise quintic y = (1/2)((2x)^5) ; [0, 0.5) y = (1/2)((2x-2)^5 + 2) ; [0...
Definition: easing.inl:154
GLM_FUNC_DECL genType quarticEaseInOut(genType const &a)
Modelled after the piecewise quartic y = (1/2)((2x)^4) ; [0, 0.5) y = -(1/2)((2x-2)^4 - 2) ; [0...
Definition: easing.inl:115
GLM_FUNC_DECL genType elasticEaseIn(genType const &a)
Modelled after the damped sine wave y = sin(13pi/2*x)*pow(2, 10 * (x - 1))
Definition: easing.inl:285
GLM_FUNC_DECL genType bounceEaseOut(genType const &a)
Definition: easing.inl:385
GLM_FUNC_DECL genType backEaseIn(genType const &a)
Definition: easing.inl:367
GLM_FUNC_DECL genType exponentialEaseOut(genType const &a)
Modelled after the exponential function y = -2^(-10x) + 1.
Definition: easing.inl:257
GLM_FUNC_DECL genType cubicEaseInOut(genType const &a)
Modelled after the piecewise cubic y = (1/2)((2x)^3) ; [0, 0.5) y = (1/2)((2x-2)^3 + 2) ; [0...
Definition: easing.inl:76
GLM_FUNC_DECL genType exponentialEaseInOut(genType const &a)
Modelled after the piecewise exponential y = (1/2)2^(10(2x - 1)) ; [0,0.5) y = -(1/2)*2^(-10(2x - 1))...
Definition: easing.inl:272
GLM_FUNC_DECL genType quinticEaseOut(genType const &a)
Modelled after the quintic y = (x - 1)^5 + 1.
Definition: easing.inl:143
GLM_FUNC_DECL genType sineEaseInOut(genType const &a)
Modelled after half sine wave.
Definition: easing.inl:192
GLM_FUNC_DECL genType elasticEaseInOut(genType const &a)
Modelled after the piecewise exponentially-damped sine wave: y = (1/2)*sin(13pi/2*(2*x))*pow(2, 10 * ((2*x) - 1)) ; [0,0.5) y = (1/2)*(sin(-13pi/2*((2x-1)+1))*pow(2,-10(2*x-1)) + 2) ; [0.5, 1].
Definition: easing.inl:305
GLM_FUNC_DECL genType quarticEaseOut(genType const &a)
Modelled after the quartic y = 1 - (x - 1)^4.
Definition: easing.inl:104
GLM_FUNC_DECL genType quadraticEaseOut(genType const &a)
Modelled after the parabola y = -x^2 + 2x.
Definition: easing.inl:28
GLM_FUNC_DECL genType circularEaseOut(genType const &a)
Modelled after shifted quadrant II of unit circle.
Definition: easing.inl:212
GLM_FUNC_DECL genType linearInterpolation(genType const &a)
Modelled after the line y = x.
Definition: easing.inl:8
GLM_FUNC_DECL genType sineEaseIn(genType const &a)
Modelled after quarter-cycle of sine wave.
Definition: easing.inl:172
GLM_FUNC_DECL genType quadraticEaseInOut(genType const &a)
Modelled after the piecewise quadratic y = (1/2)((2x)^2) ; [0, 0.5) y = -(1/2)((2x-1)*(2x-3) - 1) ; [...
Definition: easing.inl:38
GLM_FUNC_DECL genType bounceEaseIn(genType const &a)
Definition: easing.inl:410
GLM_FUNC_DECL genType bounceEaseInOut(genType const &a)
Definition: easing.inl:420