gtx_vector_query.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2011-11-23
  5. // Updated : 2011-11-23
  6. // Licence : This source is under MIT licence
  7. // File : test/gtx/vector_query.cpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #include <glm/glm.hpp>
  10. #include <glm/gtx/vector_query.hpp>
  11. int test_isNull()
  12. {
  13. int Error(0);
  14. bool TestA = glm::isNull(glm::vec4(0), 0.00001f);
  15. Error += TestA ? 0 : 1;
  16. return Error;
  17. }
  18. int test_isNormalized()
  19. {
  20. int Error(0);
  21. bool TestA = glm::isNormalized(glm::vec4(1, 0, 0, 0), 0.00001f);
  22. Error += TestA ? 0 : 1;
  23. return Error;
  24. }
  25. int test_areOrthogonal()
  26. {
  27. int Error(0);
  28. bool TestA = glm::areOrthogonal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f);
  29. Error += TestA ? 0 : 1;
  30. return Error;
  31. }
  32. int main()
  33. {
  34. int Error(0);
  35. Error += test_isNull();
  36. Error += test_isNormalized();
  37. Error += test_areOrthogonal();
  38. return Error;
  39. }