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.

37 lines
1.0 KiB

5 years ago
  1. #define GLM_ENABLE_EXPERIMENTAL
  2. #include <glm/gtc/constants.hpp>
  3. #include <glm/ext/vector_relational.hpp>
  4. #include <glm/glm.hpp>
  5. #if GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC)
  6. #include <glm/gtx/scalar_multiplication.hpp>
  7. int main()
  8. {
  9. int Error(0);
  10. glm::vec3 v(0.5, 3.1, -9.1);
  11. Error += glm::all(glm::equal(v, 1.0 * v, glm::epsilon<float>())) ? 0 : 1;
  12. Error += glm::all(glm::equal(v, 1 * v, glm::epsilon<float>())) ? 0 : 1;
  13. Error += glm::all(glm::equal(v, 1u * v, glm::epsilon<float>())) ? 0 : 1;
  14. glm::mat3 m(1, 2, 3, 4, 5, 6, 7, 8, 9);
  15. glm::vec3 w = 0.5f * m * v;
  16. Error += glm::all(glm::equal((m*v)/2, w, glm::epsilon<float>())) ? 0 : 1;
  17. Error += glm::all(glm::equal(m*(v/2), w, glm::epsilon<float>())) ? 0 : 1;
  18. Error += glm::all(glm::equal((m/2)*v, w, glm::epsilon<float>())) ? 0 : 1;
  19. Error += glm::all(glm::equal((0.5*m)*v, w, glm::epsilon<float>())) ? 0 : 1;
  20. Error += glm::all(glm::equal(0.5*(m*v), w, glm::epsilon<float>())) ? 0 : 1;
  21. return Error;
  22. }
  23. #else
  24. int main()
  25. {
  26. return 0;
  27. }
  28. #endif