29 #ifndef GLM_DETAIL_NOISE_INCLUDED
30 #define GLM_DETAIL_NOISE_INCLUDED
36 GLM_FUNC_QUALIFIER T mod289(T
const & x)
38 return x -
floor(x * static_cast<T>(1.0) / static_cast<T>(289.0)) *
static_cast<T
>(289.0);
42 GLM_FUNC_QUALIFIER T permute(T
const & x)
44 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
47 template <
typename T, precision P>
48 GLM_FUNC_QUALIFIER tvec2<T, P> permute(tvec2<T, P>
const & x)
50 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
53 template <
typename T, precision P>
54 GLM_FUNC_QUALIFIER tvec3<T, P> permute(tvec3<T, P>
const & x)
56 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
59 template <
typename T, precision P>
60 GLM_FUNC_QUALIFIER tvec4<T, P> permute(tvec4<T, P>
const & x)
62 return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
72 GLM_FUNC_QUALIFIER T taylorInvSqrt(T
const & r)
74 return T(1.79284291400159) - T(0.85373472095314) * r;
77 template <
typename T, precision P>
78 GLM_FUNC_QUALIFIER detail::tvec2<T, P> taylorInvSqrt(detail::tvec2<T, P>
const & r)
80 return T(1.79284291400159) - T(0.85373472095314) * r;
83 template <
typename T, precision P>
84 GLM_FUNC_QUALIFIER detail::tvec3<T, P> taylorInvSqrt(detail::tvec3<T, P>
const & r)
86 return T(1.79284291400159) - T(0.85373472095314) * r;
89 template <
typename T, precision P>
90 GLM_FUNC_QUALIFIER detail::tvec4<T, P> taylorInvSqrt(detail::tvec4<T, P>
const & r)
92 return T(1.79284291400159) - T(0.85373472095314) * r;
102 template <
typename T, precision P>
103 GLM_FUNC_QUALIFIER detail::tvec2<T, P> fade(detail::tvec2<T, P>
const & t)
105 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
108 template <
typename T, precision P>
109 GLM_FUNC_QUALIFIER detail::tvec3<T, P> fade(detail::tvec3<T, P>
const & t)
111 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
114 template <
typename T, precision P>
115 GLM_FUNC_QUALIFIER detail::tvec4<T, P> fade(detail::tvec4<T, P>
const & t)
117 return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
129 #endif//GLM_DETAIL_NOISE_INCLUDED
GLM_FUNC_DECL genType floor(genType const &x)
Returns a value equal to the nearest integer that is less then or equal to x.