mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 19:34:36 +00:00
branchless wrapAngle
This commit is contained in:
parent
b38a8b4e5a
commit
72a5de2320
@ -12,9 +12,7 @@ namespace glm
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T wrapAngle(T const & angle)
|
GLM_FUNC_QUALIFIER T wrapAngle(T const & angle)
|
||||||
{
|
{
|
||||||
T result = angle - floor<T>(angle * one_over_two_pi<T>()) * two_pi<T>();
|
return abs<T>(mod<T>(angle, two_pi<T>()));
|
||||||
result = result > T(0) ? result : -result;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VECTORIZE_VEC(wrapAngle)
|
VECTORIZE_VEC(wrapAngle)
|
||||||
|
Loading…
Reference in New Issue
Block a user