13 template <length_t L,
typename T, qualifier Q>
19 template <qualifier P>
25 std::rand() % std::numeric_limits<uint8>::max());
29 template <qualifier P>
35 std::rand() % std::numeric_limits<uint8>::max(),
36 std::rand() % std::numeric_limits<uint8>::max());
40 template <qualifier P>
46 std::rand() % std::numeric_limits<uint8>::max(),
47 std::rand() % std::numeric_limits<uint8>::max(),
48 std::rand() % std::numeric_limits<uint8>::max());
52 template <qualifier P>
58 std::rand() % std::numeric_limits<uint8>::max(),
59 std::rand() % std::numeric_limits<uint8>::max(),
60 std::rand() % std::numeric_limits<uint8>::max(),
61 std::rand() % std::numeric_limits<uint8>::max());
65 template <length_t L, qualifier Q>
76 template <length_t L, qualifier Q>
87 template <length_t L, qualifier Q>
98 template <length_t L,
typename T, qualifier Q>
104 template<length_t L, qualifier Q>
113 template<length_t L, qualifier Q>
122 template<length_t L, qualifier Q>
131 template<length_t L, qualifier Q>
140 template<length_t L, qualifier Q>
149 template<length_t L, qualifier Q>
158 template<length_t L, qualifier Q>
167 template<length_t L, qualifier Q>
176 template<length_t L, qualifier Q>
185 template<length_t L, qualifier Q>
194 template<length_t L, qualifier Q>
204 template<
typename genType>
205 GLM_FUNC_QUALIFIER genType
linearRand(genType Min, genType Max)
212 template<length_t L,
typename T, qualifier Q>
218 template<
typename genType>
219 GLM_FUNC_QUALIFIER genType
gaussRand(genType Mean, genType Deviation)
228 w = x1 * x1 + x2 * x2;
229 }
while(w > genType(1));
231 return static_cast<genType
>(x2 * Deviation * Deviation *
sqrt((genType(-2) *
log(w)) / w) + Mean);
234 template<length_t L,
typename T, qualifier Q>
235 GLM_FUNC_QUALIFIER vec<L, T, Q>
gaussRand(vec<L, T, Q>
const& Mean, vec<L, T, Q>
const& Deviation)
237 return detail::functor2<vec, L, T, Q>::call(
gaussRand, Mean, Deviation);
243 assert(Radius >
static_cast<T
>(0));
253 LenRadius = length(Result);
255 while(LenRadius > Radius);
263 assert(Radius >
static_cast<T
>(0));
273 LenRadius = length(Result);
275 while(LenRadius > Radius);
283 assert(Radius >
static_cast<T
>(0));
285 T a =
linearRand(T(0),
static_cast<T
>(6.283185307179586476925286766559));
292 assert(Radius >
static_cast<T
>(0));
294 T theta =
linearRand(T(0), T(6.283185307179586476925286766559f));
295 T phi = std::acos(
linearRand(T(-1.0f), T(1.0f)));
297 T x = std::sin(phi) * std::cos(theta);
298 T y = std::sin(phi) * std::sin(theta);
GLM_FUNC_QUALIFIER vec< L, T, Q > sqrt(vec< L, T, Q > const &x)
Definition func_exponential.inl:128
GLM_FUNC_QUALIFIER vec< L, T, Q > log(vec< L, T, Q > const &x)
Definition func_exponential.inl:88
GLM_FUNC_QUALIFIER vec< L, T, Q > sin(vec< L, T, Q > const &v)
Definition func_trigonometric.inl:41
GLM_FUNC_DECL genType linearRand(genType Min, genType Max)
Definition random.inl:205
GLM_FUNC_DECL vec< 3, T, defaultp > sphericalRand(T Radius)
Definition random.inl:290
GLM_FUNC_DECL genType gaussRand(genType Mean, genType Deviation)
Definition random.inl:219
GLM_FUNC_DECL vec< 2, T, defaultp > diskRand(T Radius)
Definition random.inl:241
GLM_FUNC_DECL vec< 2, T, defaultp > circularRand(T Radius)
Definition random.inl:281
GLM_FUNC_DECL vec< 3, T, defaultp > ballRand(T Radius)
Definition random.inl:261
detail namespace with internal helper functions
Definition json.h:249
Core features
Definition common.hpp:21
Definition random.inl:100
Definition qualifier.hpp:35