app
android
jni
third-party
include
glm
detail
_noise.hpp
Go to the documentation of this file.
1
29
#pragma once
30
31
namespace
glm
{
32
namespace
detail
33
{
34
template
<
typename
T>
35
GLM_FUNC_QUALIFIER
T
mod289
(
T
const
& x)
36
{
37
return
x
-
floor
(
x
*
static_cast<
T
>
(1.0) /
static_cast<
T
>
(289.0)) *
static_cast<
T
>
(289.0);
38
}
39
40
template
<
typename
T>
41
GLM_FUNC_QUALIFIER
T
permute
(
T
const
& x)
42
{
43
return
mod289
(((
x
*
static_cast<
T
>
(34)) +
static_cast<
T
>
(1)) *
x
);
44
}
45
46
template
<
typename
T, precision P>
47
GLM_FUNC_QUALIFIER
tvec2<T, P>
permute
(
tvec2<T, P>
const
& x)
48
{
49
return
mod289
(((
x
*
static_cast<
T
>
(34)) +
static_cast<
T
>
(1)) *
x
);
50
}
51
52
template
<
typename
T, precision P>
53
GLM_FUNC_QUALIFIER
tvec3<T, P>
permute
(
tvec3<T, P>
const
& x)
54
{
55
return
mod289
(((
x
*
static_cast<
T
>
(34)) +
static_cast<
T
>
(1)) *
x
);
56
}
57
58
template
<
typename
T, precision P>
59
GLM_FUNC_QUALIFIER
tvec4<T, P>
permute
(
tvec4<T, P>
const
& x)
60
{
61
return
mod289
(((
x
*
static_cast<
T
>
(34)) +
static_cast<
T
>
(1)) *
x
);
62
}
63
/*
64
template <typename T, precision P, template<typename> class vecType>
65
GLM_FUNC_QUALIFIER vecType<T, P> permute(vecType<T, P> const & x)
66
{
67
return mod289(((x * T(34)) + T(1)) * x);
68
}
69
*/
70
template
<
typename
T>
71
GLM_FUNC_QUALIFIER
T
taylorInvSqrt
(
T
const
& r)
72
{
73
return
T
(1.79284291400159) -
T
(0.85373472095314) * r;
74
}
75
76
template
<
typename
T, precision P>
77
GLM_FUNC_QUALIFIER
detail::tvec2<T, P>
taylorInvSqrt
(
detail::tvec2<T, P>
const
& r)
78
{
79
return
T
(1.79284291400159) -
T
(0.85373472095314) * r;
80
}
81
82
template
<
typename
T, precision P>
83
GLM_FUNC_QUALIFIER
detail::tvec3<T, P>
taylorInvSqrt
(
detail::tvec3<T, P>
const
& r)
84
{
85
return
T
(1.79284291400159) -
T
(0.85373472095314) * r;
86
}
87
88
template
<
typename
T, precision P>
89
GLM_FUNC_QUALIFIER
detail::tvec4<T, P>
taylorInvSqrt
(
detail::tvec4<T, P>
const
& r)
90
{
91
return
T
(1.79284291400159) -
T
(0.85373472095314) * r;
92
}
93
/*
94
template <typename T, precision P, template<typename> class vecType>
95
GLM_FUNC_QUALIFIER vecType<T, P> taylorInvSqrt(vecType<T, P> const & r)
96
{
97
return T(1.79284291400159) - T(0.85373472095314) * r;
98
}
99
*/
100
101
template
<
typename
T, precision P>
102
GLM_FUNC_QUALIFIER
detail::tvec2<T, P>
fade
(
detail::tvec2<T, P>
const
& t)
103
{
104
return
(
t
*
t
*
t
) * (
t
* (
t
*
T
(6) -
T
(15)) +
T
(10));
105
}
106
107
template
<
typename
T, precision P>
108
GLM_FUNC_QUALIFIER
detail::tvec3<T, P>
fade
(
detail::tvec3<T, P>
const
& t)
109
{
110
return
(
t
*
t
*
t
) * (
t
* (
t
*
T
(6) -
T
(15)) +
T
(10));
111
}
112
113
template
<
typename
T, precision P>
114
GLM_FUNC_QUALIFIER
detail::tvec4<T, P>
fade
(
detail::tvec4<T, P>
const
& t)
115
{
116
return
(
t
*
t
*
t
) * (
t
* (
t
*
T
(6) -
T
(15)) +
T
(10));
117
}
118
/*
119
template <typename T, precision P, template <typename> class vecType>
120
GLM_FUNC_QUALIFIER vecType<T, P> fade(vecType<T, P> const & t)
121
{
122
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
123
}
124
*/
125
}
//namespace detail
126
}
//namespace glm
127
glm::detail::mod289
GLM_FUNC_QUALIFIER T mod289(T const &x)
Definition:
_noise.hpp:35
glm::detail::permute
GLM_FUNC_QUALIFIER T permute(T const &x)
Definition:
_noise.hpp:41
detail
glm::detail::tvec3
Definition:
type_mat.hpp:37
glm::floor
GLM_FUNC_DECL genType floor(genType const &x)
glm::detail::fade
GLM_FUNC_QUALIFIER detail::tvec2< T, P > fade(detail::tvec2< T, P > const &t)
Definition:
_noise.hpp:102
glm::detail::tvec4
Definition:
type_mat.hpp:38
glm
Definition:
_literals.hpp:31
glm::detail::taylorInvSqrt
GLM_FUNC_QUALIFIER T taylorInvSqrt(T const &r)
Definition:
_noise.hpp:71
x
x
Eigen::Triplet< double >
t
Point2 t(10, 10)
GLM_FUNC_QUALIFIER
#define GLM_FUNC_QUALIFIER
Definition:
setup.hpp:729
glm::detail::tvec2
Definition:
type_mat.hpp:36
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:06