mirror of
https://github.com/g-truc/glm.git
synced 2025-04-13 00:33:01 +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
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue