fix: glm::angle() discards the sign of result for angles in range (2*pi-1, 2*pi)

This commit is contained in:
EZForever 2020-10-29 13:50:31 +08:00
parent 2bb0fb3999
commit a66b782134

View File

@ -7,7 +7,10 @@ namespace glm
{
if (abs(x.w) > cos_one_over_two<T>())
{
return asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast<T>(2);
T const a = asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast<T>(2);
if(x.w < static_cast<T>(0))
return two_pi<T>() - a;
return a;
}
return acos(x.w) * static_cast<T>(2);