matrix_query.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. #endif
  21. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  22. # pragma message("GLM: GLM_GTX_matrix_query extension included")
  23. #endif
  24. namespace glm
  25. {
  26. /// @addtogroup gtx_matrix_query
  27. /// @{
  28. /// Return whether a matrix a null matrix.
  29. /// From GLM_GTX_matrix_query extension.
  30. template<typename T, qualifier Q>
  31. GLM_FUNC_DECL bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon);
  32. /// Return whether a matrix a null matrix.
  33. /// From GLM_GTX_matrix_query extension.
  34. template<typename T, qualifier Q>
  35. GLM_FUNC_DECL bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon);
  36. /// Return whether a matrix is a null matrix.
  37. /// From GLM_GTX_matrix_query extension.
  38. template<typename T, qualifier Q>
  39. GLM_FUNC_DECL bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon);
  40. /// Return whether a matrix is an identity matrix.
  41. /// From GLM_GTX_matrix_query extension.
  42. template<length_t C, length_t R, typename T, qualifier Q, template<length_t, length_t, typename, qualifier> class matType>
  43. GLM_FUNC_DECL bool isIdentity(matType<C, R, T, Q> const& m, T const& epsilon);
  44. /// Return whether a matrix is a normalized matrix.
  45. /// From GLM_GTX_matrix_query extension.
  46. template<typename T, qualifier Q>
  47. GLM_FUNC_DECL bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon);
  48. /// Return whether a matrix is a normalized matrix.
  49. /// From GLM_GTX_matrix_query extension.
  50. template<typename T, qualifier Q>
  51. GLM_FUNC_DECL bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon);
  52. /// Return whether a matrix is a normalized matrix.
  53. /// From GLM_GTX_matrix_query extension.
  54. template<typename T, qualifier Q>
  55. GLM_FUNC_DECL bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon);
  56. /// Return whether a matrix is an orthonormalized matrix.
  57. /// From GLM_GTX_matrix_query extension.
  58. template<length_t C, length_t R, typename T, qualifier Q, template<length_t, length_t, typename, qualifier> class matType>
  59. GLM_FUNC_DECL bool isOrthogonal(matType<C, R, T, Q> const& m, T const& epsilon);
  60. /// @}
  61. }//namespace glm
  62. #include "matrix_query.inl"