Skip to content

Commit

Permalink
Add test case for glm::angle() sign bug introduced by g-truc#946
Browse files Browse the repository at this point in the history
  • Loading branch information
EZForever committed Oct 28, 2020
1 parent b3f8772 commit 2bb0fb3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/ext/ext_quaternion_trigonometric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ static int test_angle()
Error += glm::equal(A, 90.0f, Epsilon) ? 0 : 1;
}

{
glm::quat const Q = glm::angleAxis(glm::two_pi<float>() - 1.0f, glm::vec3(1, 0, 0));
float const A = glm::angle(Q);
Error += glm::equal(A, 1.0f, Epsilon) ? 1 : 0;
}

return Error;
}

Expand Down

0 comments on commit 2bb0fb3

Please sign in to comment.