This commit is contained in:
Christophe Riccio 2011-05-25 09:58:59 +01:00
parent f7d6ffc833
commit 740c28a22c

View File

@ -53,24 +53,18 @@ int test_quat_normalize()
glm::quat N = glm::normalize(Q); glm::quat N = glm::normalize(Q);
float L = glm::length(N); float L = glm::length(N);
Error += L == 1.0f ? 0 : 1; Error += L == 1.0f ? 0 : 1;
float A = glm::angle(N);
Error += glm::equalEpsilon(A, 45.0f, 0.01f) ? 0 : 1;
} }
{ {
glm::quat Q(45.0f, glm::vec3(0, 0, 2)); glm::quat Q(45.0f, glm::vec3(0, 0, 2));
glm::quat N = glm::normalize(Q); glm::quat N = glm::normalize(Q);
float L = glm::length(N); float L = glm::length(N);
Error += L == 1.0f ? 0 : 1; Error += L == 1.0f ? 0 : 1;
float A = glm::angle(N);
Error += glm::equalEpsilon(A, 45.0f, 0.01f) ? 0 : 1;
} }
{ {
glm::quat Q(45.0f, glm::vec3(1, 2, 3)); glm::quat Q(45.0f, glm::vec3(1, 2, 3));
glm::quat N = glm::normalize(Q); glm::quat N = glm::normalize(Q);
float L = glm::length(N); float L = glm::length(N);
Error += L == 1.0f ? 0 : 1; Error += L == 1.0f ? 0 : 1;
float A = glm::angle(N);
Error += glm::equalEpsilon(A, 45.0f, 0.01f) ? 0 : 1;
} }
return Error; return Error;