matrix_query.hpp 2.7 KB

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