7 template <
typename genType>
11 assert(a >= zero<genType>());
12 assert(a <= one<genType>());
17 template <
typename genType>
21 assert(a >= zero<genType>());
22 assert(a <= one<genType>());
27 template <
typename genType>
31 assert(a >= zero<genType>());
32 assert(a <= one<genType>());
34 return -(a * (a -
static_cast<genType
>(2)));
37 template <
typename genType>
41 assert(a >= zero<genType>());
42 assert(a <= one<genType>());
44 if(a <
static_cast<genType
>(0.5))
46 return static_cast<genType
>(2) * a * a;
50 return (-
static_cast<genType
>(2) * a * a) + (4 * a) - one<genType>();
54 template <
typename genType>
58 assert(a >= zero<genType>());
59 assert(a <= one<genType>());
64 template <
typename genType>
68 assert(a >= zero<genType>());
69 assert(a <= one<genType>());
71 genType
const f = a - one<genType>();
72 return f * f * f + one<genType>();
75 template <
typename genType>
79 assert(a >= zero<genType>());
80 assert(a <= one<genType>());
82 if (a <
static_cast<genType
>(0.5))
84 return static_cast<genType
>(4) * a * a * a;
88 genType
const f = ((
static_cast<genType
>(2) * a) -
static_cast<genType
>(2));
89 return static_cast<genType
>(0.5) * f * f * f + one<genType>();
93 template <
typename genType>
97 assert(a >= zero<genType>());
98 assert(a <= one<genType>());
100 return a * a * a * a;
103 template <
typename genType>
107 assert(a >= zero<genType>());
108 assert(a <= one<genType>());
110 genType
const f = (a - one<genType>());
111 return f * f * f * (one<genType>() - a) + one<genType>();
114 template <
typename genType>
118 assert(a >= zero<genType>());
119 assert(a <= one<genType>());
121 if(a <
static_cast<genType
>(0.5))
123 return static_cast<genType
>(8) * a * a * a * a;
127 genType
const f = (a - one<genType>());
128 return -
static_cast<genType
>(8) * f * f * f * f + one<genType>();
132 template <
typename genType>
136 assert(a >= zero<genType>());
137 assert(a <= one<genType>());
139 return a * a * a * a * a;
142 template <
typename genType>
146 assert(a >= zero<genType>());
147 assert(a <= one<genType>());
149 genType
const f = (a - one<genType>());
150 return f * f * f * f * f + one<genType>();
153 template <
typename genType>
157 assert(a >= zero<genType>());
158 assert(a <= one<genType>());
160 if(a <
static_cast<genType
>(0.5))
162 return static_cast<genType
>(16) * a * a * a * a * a;
166 genType
const f = ((
static_cast<genType
>(2) * a) -
static_cast<genType
>(2));
167 return static_cast<genType
>(0.5) * f * f * f * f * f + one<genType>();
171 template <
typename genType>
175 assert(a >= zero<genType>());
176 assert(a <= one<genType>());
178 return sin((a - one<genType>()) * half_pi<genType>()) + one<genType>();
181 template <
typename genType>
185 assert(a >= zero<genType>());
186 assert(a <= one<genType>());
188 return sin(a * half_pi<genType>());
191 template <
typename genType>
195 assert(a >= zero<genType>());
196 assert(a <= one<genType>());
198 return static_cast<genType
>(0.5) * (one<genType>() -
cos(a * pi<genType>()));
201 template <
typename genType>
205 assert(a >= zero<genType>());
206 assert(a <= one<genType>());
208 return one<genType>() -
sqrt(one<genType>() - (a * a));
211 template <
typename genType>
215 assert(a >= zero<genType>());
216 assert(a <= one<genType>());
218 return sqrt((
static_cast<genType
>(2) - a) * a);
221 template <
typename genType>
225 assert(a >= zero<genType>());
226 assert(a <= one<genType>());
228 if(a <
static_cast<genType
>(0.5))
230 return static_cast<genType
>(0.5) * (one<genType>() - std::sqrt(one<genType>() -
static_cast<genType
>(4) * (a * a)));
234 return static_cast<genType
>(0.5) * (std::sqrt(-((
static_cast<genType
>(2) * a) -
static_cast<genType
>(3)) * ((
static_cast<genType
>(2) * a) - one<genType>())) + one<genType>());
238 template <
typename genType>
242 assert(a >= zero<genType>());
243 assert(a <= one<genType>());
245 if(a <= zero<genType>())
249 genType
const Complementary = a - one<genType>();
250 genType
const Two =
static_cast<genType
>(2);
252 return glm::pow(Two, Complementary *
static_cast<genType
>(10));
256 template <
typename genType>
260 assert(a >= zero<genType>());
261 assert(a <= one<genType>());
263 if(a >= one<genType>())
267 return one<genType>() -
glm::pow(
static_cast<genType
>(2), -
static_cast<genType
>(10) * a);
271 template <
typename genType>
275 assert(a >= zero<genType>());
276 assert(a <= one<genType>());
278 if(a <
static_cast<genType
>(0.5))
279 return static_cast<genType
>(0.5) *
glm::pow(
static_cast<genType
>(2), (
static_cast<genType
>(20) * a) -
static_cast<genType
>(10));
281 return -
static_cast<genType
>(0.5) *
glm::pow(
static_cast<genType
>(2), (-
static_cast<genType
>(20) * a) +
static_cast<genType
>(10)) + one<genType>();
284 template <
typename genType>
288 assert(a >= zero<genType>());
289 assert(a <= one<genType>());
291 return std::sin(
static_cast<genType
>(13) * half_pi<genType>() * a) *
glm::pow(
static_cast<genType
>(2),
static_cast<genType
>(10) * (a - one<genType>()));
294 template <
typename genType>
298 assert(a >= zero<genType>());
299 assert(a <= one<genType>());
301 return std::sin(-
static_cast<genType
>(13) * half_pi<genType>() * (a + one<genType>())) *
glm::pow(
static_cast<genType
>(2), -
static_cast<genType
>(10) * a) + one<genType>();
304 template <
typename genType>
308 assert(a >= zero<genType>());
309 assert(a <= one<genType>());
311 if(a <
static_cast<genType
>(0.5))
312 return static_cast<genType
>(0.5) * std::sin(
static_cast<genType
>(13) * half_pi<genType>() * (
static_cast<genType
>(2) * a)) *
glm::pow(
static_cast<genType
>(2),
static_cast<genType
>(10) * ((
static_cast<genType
>(2) * a) - one<genType>()));
314 return static_cast<genType
>(0.5) * (std::sin(-
static_cast<genType
>(13) * half_pi<genType>() * ((
static_cast<genType
>(2) * a - one<genType>()) + one<genType>())) *
glm::pow(
static_cast<genType
>(2), -
static_cast<genType
>(10) * (
static_cast<genType
>(2) * a - one<genType>())) +
static_cast<genType
>(2));
317 template <
typename genType>
318 GLM_FUNC_QUALIFIER genType
backEaseIn(genType
const& a, genType
const& o)
321 assert(a >= zero<genType>());
322 assert(a <= one<genType>());
324 genType z = ((o + one<genType>()) * a) - o;
328 template <
typename genType>
329 GLM_FUNC_QUALIFIER genType
backEaseOut(genType
const& a, genType
const& o)
332 assert(a >= zero<genType>());
333 assert(a <= one<genType>());
335 genType n = a - one<genType>();
336 genType z = ((o + one<genType>()) * n) + o;
337 return (n * n * z) + one<genType>();
340 template <
typename genType>
341 GLM_FUNC_QUALIFIER genType
backEaseInOut(genType
const& a, genType
const& o)
344 assert(a >= zero<genType>());
345 assert(a <= one<genType>());
347 genType s = o *
static_cast<genType
>(1.525);
348 genType x =
static_cast<genType
>(0.5);
349 genType n = a /
static_cast<genType
>(0.5);
351 if (n <
static_cast<genType
>(1))
353 genType z = ((s +
static_cast<genType
>(1)) * n) - s;
354 genType m = n * n * z;
359 n -=
static_cast<genType
>(2);
360 genType z = ((s +
static_cast<genType
>(1)) * n) + s;
361 genType m = (n*n*z) +
static_cast<genType
>(2);
366 template <
typename genType>
369 return backEaseIn(a,
static_cast<genType
>(1.70158));
372 template <
typename genType>
375 return backEaseOut(a,
static_cast<genType
>(1.70158));
378 template <
typename genType>
384 template <
typename genType>
388 assert(a >= zero<genType>());
389 assert(a <= one<genType>());
391 if(a <
static_cast<genType
>(4.0 / 11.0))
393 return (
static_cast<genType
>(121) * a * a) /
static_cast<genType
>(16);
395 else if(a <
static_cast<genType
>(8.0 / 11.0))
397 return (
static_cast<genType
>(363.0 / 40.0) * a * a) - (
static_cast<genType
>(99.0 / 10.0) * a) +
static_cast<genType
>(17.0 / 5.0);
399 else if(a <
static_cast<genType
>(9.0 / 10.0))
401 return (
static_cast<genType
>(4356.0 / 361.0) * a * a) - (
static_cast<genType
>(35442.0 / 1805.0) * a) +
static_cast<genType
>(16061.0 / 1805.0);
405 return (
static_cast<genType
>(54.0 / 5.0) * a * a) - (
static_cast<genType
>(513.0 / 25.0) * a) +
static_cast<genType
>(268.0 / 25.0);
409 template <
typename genType>
413 assert(a >= zero<genType>());
414 assert(a <= one<genType>());
419 template <
typename genType>
423 assert(a >= zero<genType>());
424 assert(a <= one<genType>());
426 if(a <
static_cast<genType
>(0.5))
428 return static_cast<genType
>(0.5) * (one<genType>() -
bounceEaseOut(a *
static_cast<genType
>(2)));
432 return static_cast<genType
>(0.5) *
bounceEaseOut(a *
static_cast<genType
>(2) - one<genType>()) +
static_cast<genType
>(0.5);
GLM_FUNC_QUALIFIER vec< L, T, Q > sqrt(vec< L, T, Q > const &x)
Definition func_exponential.inl:128
GLM_FUNC_QUALIFIER vec< L, T, Q > pow(vec< L, T, Q > const &base, vec< L, T, Q > const &exponent)
Definition func_exponential.inl:72
GLM_FUNC_QUALIFIER vec< L, T, Q > sin(vec< L, T, Q > const &v)
Definition func_trigonometric.inl:41
GLM_FUNC_QUALIFIER vec< L, T, Q > cos(vec< L, T, Q > const &v)
Definition func_trigonometric.inl:50
GLM_FUNC_DECL genType quadraticEaseInOut(genType const &a)
Definition easing.inl:38
GLM_FUNC_DECL genType quinticEaseIn(genType const &a)
Definition easing.inl:133
GLM_FUNC_DECL genType circularEaseInOut(genType const &a)
Definition easing.inl:222
GLM_FUNC_DECL genType elasticEaseIn(genType const &a)
Definition easing.inl:285
GLM_FUNC_DECL genType exponentialEaseInOut(genType const &a)
Definition easing.inl:272
GLM_FUNC_DECL genType circularEaseOut(genType const &a)
Definition easing.inl:212
GLM_FUNC_DECL genType quadraticEaseOut(genType const &a)
Definition easing.inl:28
GLM_FUNC_DECL genType linearInterpolation(genType const &a)
Definition easing.inl:8
GLM_FUNC_DECL genType quinticEaseInOut(genType const &a)
Definition easing.inl:154
GLM_FUNC_DECL genType elasticEaseInOut(genType const &a)
Definition easing.inl:305
GLM_FUNC_DECL genType circularEaseIn(genType const &a)
Definition easing.inl:202
GLM_FUNC_DECL genType cubicEaseOut(genType const &a)
Definition easing.inl:65
GLM_FUNC_DECL genType quarticEaseOut(genType const &a)
Definition easing.inl:104
GLM_FUNC_DECL genType exponentialEaseOut(genType const &a)
Definition easing.inl:257
GLM_FUNC_DECL genType cubicEaseInOut(genType const &a)
Definition easing.inl:76
GLM_FUNC_DECL genType quarticEaseInOut(genType const &a)
Definition easing.inl:115
GLM_FUNC_DECL genType quinticEaseOut(genType const &a)
Definition easing.inl:143
GLM_FUNC_DECL genType exponentialEaseIn(genType const &a)
Definition easing.inl:239
GLM_FUNC_DECL genType quarticEaseIn(genType const &a)
Definition easing.inl:94
GLM_FUNC_DECL genType backEaseIn(genType const &a)
Definition easing.inl:367
GLM_FUNC_DECL genType bounceEaseOut(genType const &a)
Definition easing.inl:385
GLM_FUNC_DECL genType sineEaseInOut(genType const &a)
Definition easing.inl:192
GLM_FUNC_DECL genType bounceEaseIn(genType const &a)
Definition easing.inl:410
GLM_FUNC_DECL genType sineEaseOut(genType const &a)
Definition easing.inl:182
GLM_FUNC_DECL genType backEaseOut(genType const &a)
Definition easing.inl:373
GLM_FUNC_DECL genType backEaseInOut(genType const &a)
Definition easing.inl:379
GLM_FUNC_DECL genType elasticEaseOut(genType const &a)
Definition easing.inl:295
GLM_FUNC_DECL genType bounceEaseInOut(genType const &a)
Definition easing.inl:420
GLM_FUNC_DECL genType quadraticEaseIn(genType const &a)
Definition easing.inl:18
GLM_FUNC_DECL genType sineEaseIn(genType const &a)
Definition easing.inl:172
GLM_FUNC_DECL genType cubicEaseIn(genType const &a)
Modelled after the cubic y = x^3.
Definition easing.inl:55
Core features
Definition common.hpp:21