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.

54 lines
1.2 KiB

5 years ago
  1. #define GLM_ENABLE_EXPERIMENTAL
  2. #include <glm/gtx/log_base.hpp>
  3. #include <glm/gtc/vec1.hpp>
  4. #include <glm/gtc/epsilon.hpp>
  5. #include <glm/exponential.hpp>
  6. namespace test_log
  7. {
  8. int run()
  9. {
  10. int Error = 0;
  11. {
  12. float A = glm::log(10.f, 2.0f);
  13. float B = glm::log2(10.f);
  14. Error += glm::epsilonEqual(A, B, 0.00001f) ? 0 : 1;
  15. }
  16. {
  17. glm::vec1 A = glm::log(glm::vec1(10.f), glm::vec1(2.0f));
  18. glm::vec1 B = glm::log2(glm::vec1(10.f));
  19. Error += glm::all(glm::epsilonEqual(A, B, glm::vec1(0.00001f))) ? 0 : 1;
  20. }
  21. {
  22. glm::vec2 A = glm::log(glm::vec2(10.f), glm::vec2(2.0f));
  23. glm::vec2 B = glm::log2(glm::vec2(10.f));
  24. Error += glm::all(glm::epsilonEqual(A, B, glm::vec2(0.00001f))) ? 0 : 1;
  25. }
  26. {
  27. glm::vec3 A = glm::log(glm::vec3(10.f), glm::vec3(2.0f));
  28. glm::vec3 B = glm::log2(glm::vec3(10.f));
  29. Error += glm::all(glm::epsilonEqual(A, B, glm::vec3(0.00001f))) ? 0 : 1;
  30. }
  31. {
  32. glm::vec4 A = glm::log(glm::vec4(10.f), glm::vec4(2.0f));
  33. glm::vec4 B = glm::log2(glm::vec4(10.f));
  34. Error += glm::all(glm::epsilonEqual(A, B, glm::vec4(0.00001f))) ? 0 : 1;
  35. }
  36. return Error;
  37. }
  38. }//namespace test_log
  39. int main()
  40. {
  41. int Error(0);
  42. Error += test_log::run();
  43. return Error;
  44. }