gtx_matrix_query.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #define GLM_ENABLE_EXPERIMENTAL
  2. #include <glm/gtx/matrix_query.hpp>
  3. static int test_isNull()
  4. {
  5. int Error(0);
  6. bool TestA = glm::isNull(glm::mat4(0), 0.00001f);
  7. Error += TestA ? 0 : 1;
  8. return Error;
  9. }
  10. static int test_isIdentity()
  11. {
  12. int Error(0);
  13. {
  14. bool TestA = glm::isIdentity(glm::mat2(1), 0.00001f);
  15. Error += TestA ? 0 : 1;
  16. }
  17. {
  18. bool TestA = glm::isIdentity(glm::mat3(1), 0.00001f);
  19. Error += TestA ? 0 : 1;
  20. }
  21. {
  22. bool TestA = glm::isIdentity(glm::mat4(1), 0.00001f);
  23. Error += TestA ? 0 : 1;
  24. }
  25. return Error;
  26. }
  27. static int test_isNormalized()
  28. {
  29. int Error(0);
  30. bool TestA = glm::isNormalized(glm::mat4(1), 0.00001f);
  31. Error += TestA ? 0 : 1;
  32. return Error;
  33. }
  34. static int test_isOrthogonal()
  35. {
  36. int Error(0);
  37. {
  38. bool TestA = glm::isOrthogonal(glm::mat4(1), 0.00001f);
  39. Error += TestA ? 0 : 1;
  40. }
  41. {
  42. bool TestA = glm::isOrthogonal(glm::mat4(0), 0.00001f);
  43. Error += TestA ? 1 : 0;
  44. }
  45. return Error;
  46. }
  47. int main()
  48. {
  49. int Error(0);
  50. Error += test_isNull();
  51. Error += test_isIdentity();
  52. Error += test_isNormalized();
  53. Error += test_isOrthogonal();
  54. return Error;
  55. }