mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Merge branch '0.9.3' into swizzle
This commit is contained in:
commit
156235e574
@ -98,46 +98,46 @@ GLM_FUNC_QUALIFIER genType gaussRand
|
||||
w = x1 * x1 + x2 * x2;
|
||||
} while(w > genType(1));
|
||||
|
||||
return x2 * std_deviation * std_deviation * sqrt((genType(-2) * log(w)) / w) + mean;
|
||||
return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T> gaussRand
|
||||
(
|
||||
detail::tvec2<T> const & Min,
|
||||
detail::tvec2<T> const & Max
|
||||
detail::tvec2<T> const & Mean,
|
||||
detail::tvec2<T> const & Deviation
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T>(
|
||||
gaussRand(Min.x, Max.x),
|
||||
gaussRand(Min.y, Max.y));
|
||||
gaussRand(Mean.x, Deviation.x),
|
||||
gaussRand(Mean.y, Deviation.y));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T> gaussRand
|
||||
(
|
||||
detail::tvec3<T> const & Min,
|
||||
detail::tvec3<T> const & Max
|
||||
detail::tvec3<T> const & Mean,
|
||||
detail::tvec3<T> const & Deviation
|
||||
)
|
||||
{
|
||||
return detail::tvec3<T>(
|
||||
gaussRand(Min.x, Max.x),
|
||||
gaussRand(Min.y, Max.y),
|
||||
gaussRand(Min.z, Max.z));
|
||||
gaussRand(Mean.x, Deviation.x),
|
||||
gaussRand(Mean.y, Deviation.y),
|
||||
gaussRand(Mean.z, Deviation.z));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T> gaussRand
|
||||
(
|
||||
detail::tvec4<T> const & Min,
|
||||
detail::tvec4<T> const & Max
|
||||
detail::tvec4<T> const & Mean,
|
||||
detail::tvec4<T> const & Deviation
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T>(
|
||||
gaussRand(Min.x, Max.x),
|
||||
gaussRand(Min.y, Max.y),
|
||||
gaussRand(Min.z, Max.z),
|
||||
gaussRand(Min.w, Max.w));
|
||||
gaussRand(Mean.x, Deviation.x),
|
||||
gaussRand(Mean.y, Deviation.y),
|
||||
gaussRand(Mean.z, Deviation.z),
|
||||
gaussRand(Mean.w, Deviation.w));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -184,7 +184,7 @@ GLM_FUNC_QUALIFIER detail::tvec2<T> circularRand
|
||||
T const & Radius
|
||||
)
|
||||
{
|
||||
T a = compRand1<T>(T(0), T(6.283185307179586476925286766559f));
|
||||
T a = linearRand(T(0), T(6.283185307179586476925286766559f));
|
||||
return detail::tvec2<T>(cos(a), sin(a)) * Radius;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ int test_linearRand()
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
/*
|
||||
int test_normalizedRand2()
|
||||
{
|
||||
int Error = 0;
|
||||
@ -88,14 +88,14 @@ int test_normalizedRand3()
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
Error += test_linearRand();
|
||||
Error += test_normalizedRand2();
|
||||
Error += test_normalizedRand3();
|
||||
//Error += test_normalizedRand2();
|
||||
//Error += test_normalizedRand3();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user