35 #include "../vec2.hpp"
36 #include "../vec3.hpp"
37 #include "../vec4.hpp"
38 #include "../common.hpp"
44 GLM_FUNC_QUALIFIER T mod289(T
const & x)
46 return x -
floor(x * static_cast<T>(1.0) / static_cast<T>(289.0)) *
static_cast<T
>(289.0);
50 GLM_FUNC_QUALIFIER T permute(T
const & x)
52 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
55 template <
typename T, precision P>
56 GLM_FUNC_QUALIFIER tvec2<T, P> permute(tvec2<T, P>
const & x)
58 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
61 template <
typename T, precision P>
62 GLM_FUNC_QUALIFIER tvec3<T, P> permute(tvec3<T, P>
const & x)
64 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
67 template <
typename T, precision P>
68 GLM_FUNC_QUALIFIER tvec4<T, P> permute(tvec4<T, P>
const & x)
70 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
80 GLM_FUNC_QUALIFIER T taylorInvSqrt(T
const & r)
82 return T(1.79284291400159) - T(0.85373472095314) * r;
85 template <
typename T, precision P>
86 GLM_FUNC_QUALIFIER tvec2<T, P> taylorInvSqrt(tvec2<T, P>
const & r)
88 return T(1.79284291400159) - T(0.85373472095314) * r;
91 template <
typename T, precision P>
92 GLM_FUNC_QUALIFIER tvec3<T, P> taylorInvSqrt(tvec3<T, P>
const & r)
94 return T(1.79284291400159) - T(0.85373472095314) * r;
97 template <
typename T, precision P>
98 GLM_FUNC_QUALIFIER tvec4<T, P> taylorInvSqrt(tvec4<T, P>
const & r)
100 return T(1.79284291400159) - T(0.85373472095314) * r;
110 template <
typename T, precision P>
111 GLM_FUNC_QUALIFIER tvec2<T, P> fade(tvec2<T, P>
const & t)
113 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
116 template <
typename T, precision P>
117 GLM_FUNC_QUALIFIER tvec3<T, P> fade(tvec3<T, P>
const & t)
119 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
122 template <
typename T, precision P>
123 GLM_FUNC_QUALIFIER tvec4<T, P> fade(tvec4<T, P>
const & t)
125 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.