matrix_query.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /// @ref gtx_matrix_query
  2. /// @file glm/gtx/matrix_query.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtx_vector_query (dependence)
  6. ///
  7. /// @defgroup gtx_matrix_query GLM_GTX_matrix_query
  8. /// @ingroup gtx
  9. ///
  10. /// Include <glm/gtx/matrix_query.hpp> to use the features of this extension.
  11. ///
  12. /// Query to evaluate matrix properties
  13. #pragma once
  14. // Dependency:
  15. #include "../glm.hpp"
  16. #include "../gtx/vector_query.hpp"
  17. #include <limits>
  18. #ifndef GLM_ENABLE_EXPERIMENTAL
  19. # error "GLM: GLM_GTX_matrix_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
  20. #elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  21. # pragma message("GLM: GLM_GTX_matrix_query extension included")
  22. #endif
  23. namespace glm
  24. {
  25. /// @addtogroup gtx_matrix_query
  26. /// @{
  27. /// Return whether a matrix a null matrix.
  28. /// From GLM_GTX_matrix_query extension.
  29. template<typename T, qualifier Q>
  30. GLM_FUNC_DECL bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon);
  31. /// Return whether a matrix a null matrix.
  32. /// From GLM_GTX_matrix_query extension.
  33. template<typename T, qualifier Q>
  34. GLM_FUNC_DECL bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon);
  35. /// Return whether a matrix is a null matrix.
  36. /// From GLM_GTX_matrix_query extension.
  37. template<typename T, qualifier Q>
  38. GLM_FUNC_DECL bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon);
  39. /// Return whether a matrix is an identity matrix.
  40. /// From GLM_GTX_matrix_query extension.
  41. template<length_t C, length_t R, typename T, qualifier Q, template<length_t, length_t, typename, qualifier> class matType>
  42. GLM_FUNC_DECL bool isIdentity(matType<C, R, T, Q> const& m, T const& epsilon);
  43. /// Return whether a matrix is a normalized matrix.
  44. /// From GLM_GTX_matrix_query extension.
  45. template<typename T, qualifier Q>
  46. GLM_FUNC_DECL bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon);
  47. /// Return whether a matrix is a normalized matrix.
  48. /// From GLM_GTX_matrix_query extension.
  49. template<typename T, qualifier Q>
  50. GLM_FUNC_DECL bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon);
  51. /// Return whether a matrix is a normalized matrix.
  52. /// From GLM_GTX_matrix_query extension.
  53. template<typename T, qualifier Q>
  54. GLM_FUNC_DECL bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon);
  55. /// Return whether a matrix is an orthonormalized matrix.
  56. /// From GLM_GTX_matrix_query extension.
  57. template<length_t C, length_t R, typename T, qualifier Q, template<length_t, length_t, typename, qualifier> class matType>
  58. GLM_FUNC_DECL bool isOrthogonal(matType<C, R, T, Q> const& m, T const& epsilon);
  59. /// @}
  60. }//namespace glm
  61. #include "matrix_query.inl"