Add files via upload

This commit is contained in:
CaptainCarrot 2017-07-22 17:08:49 +02:00 committed by GitHub
parent 1ad55c5016
commit 7223cd1b47

View File

@ -90,7 +90,24 @@ int test_log()
return Error; return Error;
} }
int main() int test_quatLookAt()
{
int Error(0);
glm::vec3 eye(0.0f);
glm::vec3 center(1.1f, -2.0f, 3.1416f);
glm::vec3 up = glm::vec3(-0.17f, 7.23f, -1.744f);
glm::quat test_quat = glm::quatLookAt(center - eye, up);
glm::quat test_mat = glm::conjugate(glm::quat_cast(glm::lookAt(eye, center, up)));
Error += static_cast<int>(glm::abs(glm::length(test_quat) - 1.0f) > glm::epsilon<float>());
Error += static_cast<int>(glm::min(glm::length(test_quat + (-test_mat)), glm::length(test_quat + test_mat)) > glm::epsilon<float>());
return Error;
}
int main1()
{ {
int Error = 0; int Error = 0;
@ -98,6 +115,7 @@ int main()
Error += test_rotation(); Error += test_rotation();
Error += test_quat_fastMix(); Error += test_quat_fastMix();
Error += test_quat_shortMix(); Error += test_quat_shortMix();
Error += test_quatLookAt();
return Error; return Error;
} }