mirror of
https://github.com/g-truc/glm.git
synced 2024-11-16 23:04:35 +00:00
Add files via upload
This commit is contained in:
parent
6912f621d5
commit
7ba519491e
@ -105,13 +105,13 @@ int test_quat_lookAt()
|
|||||||
glm::quat test_quat_LH = glm::quatLookAtLH(glm::normalize(center - eye), up);
|
glm::quat test_quat_LH = glm::quatLookAtLH(glm::normalize(center - eye), up);
|
||||||
glm::quat test_mat_LH = glm::conjugate(glm::quat_cast(glm::lookAtLH(eye, center, up)));
|
glm::quat test_mat_LH = glm::conjugate(glm::quat_cast(glm::lookAtLH(eye, center, up)));
|
||||||
Error += static_cast<int>(glm::abs(glm::length(test_quat_LH) - 1.0f) > glm::epsilon<float>());
|
Error += static_cast<int>(glm::abs(glm::length(test_quat_LH) - 1.0f) > glm::epsilon<float>());
|
||||||
Error += static_cast<int>(glm::min(glm::length(test_quat_LH + (-test_mat_LH)), glm::length(test_quat_LH + test_mat_RH)) > glm::epsilon<float>());
|
Error += static_cast<int>(glm::min(glm::length(test_quat_LH - test_mat_LH), glm::length(test_quat_LH + test_mat_RH)) > glm::epsilon<float>());
|
||||||
|
|
||||||
// Test right-handed implementation
|
// Test right-handed implementation
|
||||||
glm::quat test_quat_RH = glm::quatLookAtRH(glm::normalize(center - eye), up);
|
glm::quat test_quat_RH = glm::quatLookAtRH(glm::normalize(center - eye), up);
|
||||||
glm::quat test_mat_RH = glm::conjugate(glm::quat_cast(glm::lookAtRH(eye, center, up)));
|
glm::quat test_mat_RH = glm::conjugate(glm::quat_cast(glm::lookAtRH(eye, center, up)));
|
||||||
Error += static_cast<int>(glm::abs(glm::length(test_quat_RH) - 1.0f) > glm::epsilon<float>());
|
Error += static_cast<int>(glm::abs(glm::length(test_quat_RH) - 1.0f) > glm::epsilon<float>());
|
||||||
Error += static_cast<int>(glm::min(glm::length(test_quat_RH + (-test_mat_RH)), glm::length(test_quat_RH + test_mat_RH)) > glm::epsilon<float>());
|
Error += static_cast<int>(glm::min(glm::length(test_quat_RH - test_mat_RH), glm::length(test_quat_RH + test_mat_RH)) > glm::epsilon<float>());
|
||||||
|
|
||||||
return Error;
|
return Error;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user