matrix_operation.hpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. #ifndef GLM_ENABLE_EXPERIMENTAL
  16. # error "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."
  17. #endif
  18. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  19. # pragma message("GLM: GLM_GTX_matrix_operation extension included")
  20. #endif
  21. namespace glm
  22. {
  23. /// @addtogroup gtx_matrix_operation
  24. /// @{
  25. //! Build a diagonal matrix.
  26. //! From GLM_GTX_matrix_operation extension.
  27. template<typename T, qualifier Q>
  28. GLM_FUNC_DECL mat<2, 2, T, Q> diagonal2x2(
  29. vec<2, T, Q> const& v);
  30. //! Build a diagonal matrix.
  31. //! From GLM_GTX_matrix_operation extension.
  32. template<typename T, qualifier Q>
  33. GLM_FUNC_DECL mat<2, 3, T, Q> diagonal2x3(
  34. vec<2, T, Q> const& v);
  35. //! Build a diagonal matrix.
  36. //! From GLM_GTX_matrix_operation extension.
  37. template<typename T, qualifier Q>
  38. GLM_FUNC_DECL mat<2, 4, T, Q> diagonal2x4(
  39. vec<2, T, Q> const& v);
  40. //! Build a diagonal matrix.
  41. //! From GLM_GTX_matrix_operation extension.
  42. template<typename T, qualifier Q>
  43. GLM_FUNC_DECL mat<3, 2, T, Q> diagonal3x2(
  44. vec<2, T, Q> const& v);
  45. //! Build a diagonal matrix.
  46. //! From GLM_GTX_matrix_operation extension.
  47. template<typename T, qualifier Q>
  48. GLM_FUNC_DECL mat<3, 3, T, Q> diagonal3x3(
  49. vec<3, T, Q> const& v);
  50. //! Build a diagonal matrix.
  51. //! From GLM_GTX_matrix_operation extension.
  52. template<typename T, qualifier Q>
  53. GLM_FUNC_DECL mat<3, 4, T, Q> diagonal3x4(
  54. vec<3, T, Q> const& v);
  55. //! Build a diagonal matrix.
  56. //! From GLM_GTX_matrix_operation extension.
  57. template<typename T, qualifier Q>
  58. GLM_FUNC_DECL mat<4, 2, T, Q> diagonal4x2(
  59. vec<2, T, Q> const& v);
  60. //! Build a diagonal matrix.
  61. //! From GLM_GTX_matrix_operation extension.
  62. template<typename T, qualifier Q>
  63. GLM_FUNC_DECL mat<4, 3, T, Q> diagonal4x3(
  64. vec<3, T, Q> const& v);
  65. //! Build a diagonal matrix.
  66. //! From GLM_GTX_matrix_operation extension.
  67. template<typename T, qualifier Q>
  68. GLM_FUNC_DECL mat<4, 4, T, Q> diagonal4x4(
  69. vec<4, T, Q> const& v);
  70. /// Build an adjugate matrix.
  71. /// From GLM_GTX_matrix_operation extension.
  72. template<typename T, qualifier Q>
  73. GLM_FUNC_DECL mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m);
  74. /// Build an adjugate matrix.
  75. /// From GLM_GTX_matrix_operation extension.
  76. template<typename T, qualifier Q>
  77. GLM_FUNC_DECL mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m);
  78. /// Build an adjugate matrix.
  79. /// From GLM_GTX_matrix_operation extension.
  80. template<typename T, qualifier Q>
  81. GLM_FUNC_DECL mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m);
  82. /// @}
  83. }//namespace glm
  84. #include "matrix_operation.inl"