matrix_operation.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /// @ref gtx_matrix_operation
  2. /// @file glm/gtx/matrix_operation.hpp
  3. ///
  4. /// @see core (dependence)
  5. ///
  6. /// @defgroup gtx_matrix_operation GLM_GTX_matrix_operation
  7. /// @ingroup gtx
  8. ///
  9. /// Include <glm/gtx/matrix_operation.hpp> to use the features of this extension.
  10. ///
  11. /// Build diagonal matrices from vectors.
  12. #pragma once
  13. // Dependency:
  14. #include "../glm.hpp"
  15. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  16. # ifndef GLM_ENABLE_EXPERIMENTAL
  17. # pragma message("GLM: GLM_GTX_matrix_operation 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.")
  18. # else
  19. # pragma message("GLM: GLM_GTX_matrix_operation extension included")
  20. # endif
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup gtx_matrix_operation
  25. /// @{
  26. //! Build a diagonal matrix.
  27. //! From GLM_GTX_matrix_operation extension.
  28. template<typename T, qualifier Q>
  29. GLM_FUNC_DECL mat<2, 2, T, Q> diagonal2x2(
  30. vec<2, T, Q> const& v);
  31. //! Build a diagonal matrix.
  32. //! From GLM_GTX_matrix_operation extension.
  33. template<typename T, qualifier Q>
  34. GLM_FUNC_DECL mat<2, 3, T, Q> diagonal2x3(
  35. vec<2, T, Q> const& v);
  36. //! Build a diagonal matrix.
  37. //! From GLM_GTX_matrix_operation extension.
  38. template<typename T, qualifier Q>
  39. GLM_FUNC_DECL mat<2, 4, T, Q> diagonal2x4(
  40. vec<2, T, Q> const& v);
  41. //! Build a diagonal matrix.
  42. //! From GLM_GTX_matrix_operation extension.
  43. template<typename T, qualifier Q>
  44. GLM_FUNC_DECL mat<3, 2, T, Q> diagonal3x2(
  45. vec<2, T, Q> const& v);
  46. //! Build a diagonal matrix.
  47. //! From GLM_GTX_matrix_operation extension.
  48. template<typename T, qualifier Q>
  49. GLM_FUNC_DECL mat<3, 3, T, Q> diagonal3x3(
  50. vec<3, T, Q> const& v);
  51. //! Build a diagonal matrix.
  52. //! From GLM_GTX_matrix_operation extension.
  53. template<typename T, qualifier Q>
  54. GLM_FUNC_DECL mat<3, 4, T, Q> diagonal3x4(
  55. vec<3, T, Q> const& v);
  56. //! Build a diagonal matrix.
  57. //! From GLM_GTX_matrix_operation extension.
  58. template<typename T, qualifier Q>
  59. GLM_FUNC_DECL mat<4, 2, T, Q> diagonal4x2(
  60. vec<2, T, Q> const& v);
  61. //! Build a diagonal matrix.
  62. //! From GLM_GTX_matrix_operation extension.
  63. template<typename T, qualifier Q>
  64. GLM_FUNC_DECL mat<4, 3, T, Q> diagonal4x3(
  65. vec<3, T, Q> const& v);
  66. //! Build a diagonal matrix.
  67. //! From GLM_GTX_matrix_operation extension.
  68. template<typename T, qualifier Q>
  69. GLM_FUNC_DECL mat<4, 4, T, Q> diagonal4x4(
  70. vec<4, T, Q> const& v);
  71. /// Build an adjugate matrix.
  72. /// From GLM_GTX_matrix_operation extension.
  73. template<typename T, qualifier Q>
  74. GLM_FUNC_DECL mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m);
  75. /// Build an adjugate matrix.
  76. /// From GLM_GTX_matrix_operation extension.
  77. template<typename T, qualifier Q>
  78. GLM_FUNC_DECL mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m);
  79. /// Build an adjugate matrix.
  80. /// From GLM_GTX_matrix_operation extension.
  81. template<typename T, qualifier Q>
  82. GLM_FUNC_DECL mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m);
  83. /// @}
  84. }//namespace glm
  85. #include "matrix_operation.inl"