gtx_matrix_query.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2011-11-22
  5. // Updated : 2011-11-22
  6. // Licence : This source is under MIT licence
  7. // File : test/gtx/matrix_query.cpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #define GLM_FORCE_RADIANS
  10. #include <glm/gtx/matrix_query.hpp>
  11. int test_isNull()
  12. {
  13. int Error(0);
  14. bool TestA = glm::isNull(glm::mat4(0), 0.00001f);
  15. Error += TestA ? 0 : 1;
  16. return Error;
  17. }
  18. int test_isIdentity()
  19. {
  20. int Error(0);
  21. {
  22. bool TestA = glm::isIdentity(glm::mat2(1), 0.00001f);
  23. Error += TestA ? 0 : 1;
  24. }
  25. {
  26. bool TestA = glm::isIdentity(glm::mat3(1), 0.00001f);
  27. Error += TestA ? 0 : 1;
  28. }
  29. {
  30. bool TestA = glm::isIdentity(glm::mat4(1), 0.00001f);
  31. Error += TestA ? 0 : 1;
  32. }
  33. return Error;
  34. }
  35. int test_isNormalized()
  36. {
  37. int Error(0);
  38. bool TestA = glm::isNormalized(glm::mat4(1), 0.00001f);
  39. Error += TestA ? 0 : 1;
  40. return Error;
  41. }
  42. int test_isOrthogonal()
  43. {
  44. int Error(0);
  45. bool TestA = glm::isOrthogonal(glm::mat4(1), 0.00001f);
  46. Error += TestA ? 0 : 1;
  47. return Error;
  48. }
  49. int main()
  50. {
  51. int Error(0);
  52. Error += test_isNull();
  53. Error += test_isIdentity();
  54. Error += test_isNormalized();
  55. Error += test_isOrthogonal();
  56. return Error;
  57. }