mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
fix: glm::angle() discards the sign of result for angles in range (2*pi-1, 2*pi)
This commit is contained in:
parent
2bb0fb3999
commit
a66b782134
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user