35 #include "../vec2.hpp"
36 #include "../vec3.hpp"
37 #include "../vec4.hpp"
43 GLM_FUNC_QUALIFIER T mod289(T
const & x)
45 return x -
floor(x * static_cast<T>(1.0) / static_cast<T>(289.0)) *
static_cast<T
>(289.0);
49 GLM_FUNC_QUALIFIER T permute(T
const & x)
51 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
54 template <
typename T, precision P>
55 GLM_FUNC_QUALIFIER tvec2<T, P> permute(tvec2<T, P>
const & x)
57 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
60 template <
typename T, precision P>
61 GLM_FUNC_QUALIFIER tvec3<T, P> permute(tvec3<T, P>
const & x)
63 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
66 template <
typename T, precision P>
67 GLM_FUNC_QUALIFIER tvec4<T, P> permute(tvec4<T, P>
const & x)
69 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
79 GLM_FUNC_QUALIFIER T taylorInvSqrt(T
const & r)
81 return T(1.79284291400159) - T(0.85373472095314) * r;
84 template <
typename T, precision P>
85 GLM_FUNC_QUALIFIER tvec2<T, P> taylorInvSqrt(tvec2<T, P>
const & r)
87 return T(1.79284291400159) - T(0.85373472095314) * r;
90 template <
typename T, precision P>
91 GLM_FUNC_QUALIFIER tvec3<T, P> taylorInvSqrt(tvec3<T, P>
const & r)
93 return T(1.79284291400159) - T(0.85373472095314) * r;
96 template <
typename T, precision P>
97 GLM_FUNC_QUALIFIER tvec4<T, P> taylorInvSqrt(tvec4<T, P>
const & r)
99 return T(1.79284291400159) - T(0.85373472095314) * r;
109 template <
typename T, precision P>
110 GLM_FUNC_QUALIFIER tvec2<T, P> fade(tvec2<T, P>
const & t)
112 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
115 template <
typename T, precision P>
116 GLM_FUNC_QUALIFIER tvec3<T, P> fade(tvec3<T, P>
const & t)
118 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
121 template <
typename T, precision P>
122 GLM_FUNC_QUALIFIER tvec4<T, P> fade(tvec4<T, P>
const & t)
124 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.