3 #include "../common.hpp"
9 GLM_FUNC_QUALIFIER T mod289(T
const& x)
11 return x -
floor(x * (static_cast<T>(1.0) / static_cast<T>(289.0))) *
static_cast<T
>(289.0);
15 GLM_FUNC_QUALIFIER T permute(T
const& x)
17 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
20 template<
typename T, qualifier Q>
21 GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q>
const& x)
23 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
26 template<
typename T, qualifier Q>
27 GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q>
const& x)
29 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
32 template<
typename T, qualifier Q>
33 GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q>
const& x)
35 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
39 GLM_FUNC_QUALIFIER T taylorInvSqrt(T
const& r)
41 return static_cast<T
>(1.79284291400159) -
static_cast<T
>(0.85373472095314) * r;
44 template<
typename T, qualifier Q>
45 GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q>
const& r)
47 return static_cast<T
>(1.79284291400159) -
static_cast<T
>(0.85373472095314) * r;
50 template<
typename T, qualifier Q>
51 GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q>
const& r)
53 return static_cast<T
>(1.79284291400159) -
static_cast<T
>(0.85373472095314) * r;
56 template<
typename T, qualifier Q>
57 GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q>
const& r)
59 return static_cast<T
>(1.79284291400159) -
static_cast<T
>(0.85373472095314) * r;
62 template<
typename T, qualifier Q>
63 GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q>
const& t)
65 return (t * t * t) * (t * (t *
static_cast<T
>(6) - static_cast<T>(15)) + static_cast<T>(10));
68 template<
typename T, qualifier Q>
69 GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q>
const& t)
71 return (t * t * t) * (t * (t *
static_cast<T
>(6) - static_cast<T>(15)) + static_cast<T>(10));
74 template<
typename T, qualifier Q>
75 GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q>
const& t)
77 return (t * t * t) * (t * (t *
static_cast<T
>(6) - static_cast<T>(15)) + static_cast<T>(10));
GLM_FUNC_DECL vec< L, T, Q > floor(vec< L, T, Q > const &x)
Returns a value equal to the nearest integer that is less then or equal to x.