9 #include "../common.hpp"
15 GLM_FUNC_QUALIFIER T mod289(T
const & x)
17 return x -
floor(x * static_cast<T>(1.0) / static_cast<T>(289.0)) *
static_cast<T
>(289.0);
21 GLM_FUNC_QUALIFIER T permute(T
const & x)
23 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
26 template <
typename T, precision P>
27 GLM_FUNC_QUALIFIER tvec2<T, P> permute(tvec2<T, P>
const & x)
29 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
32 template <
typename T, precision P>
33 GLM_FUNC_QUALIFIER tvec3<T, P> permute(tvec3<T, P>
const & x)
35 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
38 template <
typename T, precision P>
39 GLM_FUNC_QUALIFIER tvec4<T, P> permute(tvec4<T, P>
const & x)
41 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
51 GLM_FUNC_QUALIFIER T taylorInvSqrt(T
const & r)
53 return T(1.79284291400159) - T(0.85373472095314) * r;
56 template <
typename T, precision P>
57 GLM_FUNC_QUALIFIER tvec2<T, P> taylorInvSqrt(tvec2<T, P>
const & r)
59 return T(1.79284291400159) - T(0.85373472095314) * r;
62 template <
typename T, precision P>
63 GLM_FUNC_QUALIFIER tvec3<T, P> taylorInvSqrt(tvec3<T, P>
const & r)
65 return T(1.79284291400159) - T(0.85373472095314) * r;
68 template <
typename T, precision P>
69 GLM_FUNC_QUALIFIER tvec4<T, P> taylorInvSqrt(tvec4<T, P>
const & r)
71 return T(1.79284291400159) - T(0.85373472095314) * r;
81 template <
typename T, precision P>
82 GLM_FUNC_QUALIFIER tvec2<T, P> fade(tvec2<T, P>
const & t)
84 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
87 template <
typename T, precision P>
88 GLM_FUNC_QUALIFIER tvec3<T, P> fade(tvec3<T, P>
const & t)
90 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
93 template <
typename T, precision P>
94 GLM_FUNC_QUALIFIER tvec4<T, P> fade(tvec4<T, P>
const & t)
96 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
GLM_FUNC_DECL vecType< T, P > floor(vecType< T, P > const &x)
Returns a value equal to the nearest integer that is less then or equal to x.