Platformer in OpenGL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

5 years ago
  1. #include <glm/gtc/constants.hpp>
  2. #include <glm/ext/quaternion_relational.hpp>
  3. #include <glm/ext/quaternion_float.hpp>
  4. #include <glm/ext/quaternion_float_precision.hpp>
  5. #include <glm/ext/quaternion_double.hpp>
  6. #include <glm/ext/quaternion_double_precision.hpp>
  7. #include <glm/ext/vector_float3.hpp>
  8. #include <glm/ext/vector_float3_precision.hpp>
  9. #include <glm/ext/vector_double3.hpp>
  10. #include <glm/ext/vector_double3_precision.hpp>
  11. template <typename quaType>
  12. static int test_equal()
  13. {
  14. int Error = 0;
  15. quaType const Q(1, 0, 0, 0);
  16. quaType const P(1, 0, 0, 0);
  17. Error += glm::all(glm::equal(Q, P, glm::epsilon<float>())) ? 0 : 1;
  18. return Error;
  19. }
  20. template <typename quaType>
  21. static int test_notEqual()
  22. {
  23. int Error = 0;
  24. quaType const Q(1, 0, 0, 0);
  25. quaType const P(1, 0, 0, 0);
  26. Error += glm::any(glm::notEqual(Q, P, glm::epsilon<float>())) ? 1 : 0;
  27. return Error;
  28. }
  29. int main()
  30. {
  31. int Error = 0;
  32. Error += test_equal<glm::quat>();
  33. Error += test_equal<glm::lowp_quat>();
  34. Error += test_equal<glm::mediump_quat>();
  35. Error += test_equal<glm::highp_quat>();
  36. Error += test_notEqual<glm::quat>();
  37. Error += test_notEqual<glm::lowp_quat>();
  38. Error += test_notEqual<glm::mediump_quat>();
  39. Error += test_notEqual<glm::highp_quat>();
  40. return Error;
  41. }