|
|
@ -18,12 +18,12 @@ namespace glm |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'angle' only accept floating-point inputs"); |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'angle' only accept floating-point inputs"); |
|
|
|
|
|
|
|
|
|
|
|
genType Dot = clamp(dot(x, y), genType(0), genType(1)); |
|
|
|
genType const Angle(acos(clamp(dot(x, y), genType(0), genType(1)))); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef GLM_FORCE_RADIANS |
|
|
|
#ifdef GLM_FORCE_RADIANS |
|
|
|
return acos(Dot); |
|
|
|
return Angle; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return degrees(acos(Dot)); |
|
|
|
return degrees(Angle); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -36,12 +36,12 @@ namespace glm |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'angle' only accept floating-point inputs"); |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'angle' only accept floating-point inputs"); |
|
|
|
|
|
|
|
|
|
|
|
T Dot = clamp(dot(x, y), T(0), T(1)); |
|
|
|
genType const Angle(acos(clamp(dot(x, y), T(0), T(1))); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef GLM_FORCE_RADIANS |
|
|
|
#ifdef GLM_FORCE_RADIANS |
|
|
|
return acos(Dot); |
|
|
|
return Angle; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return degrees(acos(Dot)); |
|
|
|
return degrees(Angle); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ namespace glm |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs"); |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs"); |
|
|
|
|
|
|
|
|
|
|
|
T Dot = clamp(dot(x, y), T(0), T(1)); |
|
|
|
T const Dot = clamp(dot(x, y), T(0), T(1)); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef GLM_FORCE_RADIANS |
|
|
|
#ifdef GLM_FORCE_RADIANS |
|
|
|
T const Angle(acos(Dot)); |
|
|
|
T const Angle(acos(Dot)); |
|
|
@ -79,7 +79,7 @@ namespace glm |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs"); |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'orientedAngle' only accept floating-point inputs"); |
|
|
|
|
|
|
|
|
|
|
|
T Dot = clamp(dot(x, y), T(0), T(1)); |
|
|
|
T const Dot = clamp(dot(x, y), T(0), T(1)); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef GLM_FORCE_RADIANS |
|
|
|
#ifdef GLM_FORCE_RADIANS |
|
|
|
T const Angle(acos(Dot)); |
|
|
|
T const Angle(acos(Dot)); |
|
|
|