matrix_major_storage.hpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /// @ref gtx_matrix_major_storage
  2. /// @file glm/gtx/matrix_major_storage.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtx_extented_min_max (dependence)
  6. ///
  7. /// @defgroup gtx_matrix_major_storage GLM_GTX_matrix_major_storage
  8. /// @ingroup gtx
  9. ///
  10. /// Include <glm/gtx/matrix_major_storage.hpp> to use the features of this extension.
  11. ///
  12. /// Build matrices with specific matrix order, row or column
  13. #pragma once
  14. // Dependency:
  15. #include "../glm.hpp"
  16. #ifndef GLM_ENABLE_EXPERIMENTAL
  17. # error "GLM: GLM_GTX_matrix_major_storage 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. #endif
  19. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  20. # pragma message("GLM: GLM_GTX_matrix_major_storage extension included")
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup gtx_matrix_major_storage
  25. /// @{
  26. //! Build a row major matrix from row vectors.
  27. //! From GLM_GTX_matrix_major_storage extension.
  28. template<typename T, qualifier Q>
  29. GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2(
  30. vec<2, T, Q> const& v1,
  31. vec<2, T, Q> const& v2);
  32. //! Build a row major matrix from other matrix.
  33. //! From GLM_GTX_matrix_major_storage extension.
  34. template<typename T, qualifier Q>
  35. GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2(
  36. mat<2, 2, T, Q> const& m);
  37. //! Build a row major matrix from row vectors.
  38. //! From GLM_GTX_matrix_major_storage extension.
  39. template<typename T, qualifier Q>
  40. GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3(
  41. vec<3, T, Q> const& v1,
  42. vec<3, T, Q> const& v2,
  43. vec<3, T, Q> const& v3);
  44. //! Build a row major matrix from other matrix.
  45. //! From GLM_GTX_matrix_major_storage extension.
  46. template<typename T, qualifier Q>
  47. GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3(
  48. mat<3, 3, T, Q> const& m);
  49. //! Build a row major matrix from row vectors.
  50. //! From GLM_GTX_matrix_major_storage extension.
  51. template<typename T, qualifier Q>
  52. GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4(
  53. vec<4, T, Q> const& v1,
  54. vec<4, T, Q> const& v2,
  55. vec<4, T, Q> const& v3,
  56. vec<4, T, Q> const& v4);
  57. //! Build a row major matrix from other matrix.
  58. //! From GLM_GTX_matrix_major_storage extension.
  59. template<typename T, qualifier Q>
  60. GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4(
  61. mat<4, 4, T, Q> const& m);
  62. //! Build a column major matrix from column vectors.
  63. //! From GLM_GTX_matrix_major_storage extension.
  64. template<typename T, qualifier Q>
  65. GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2(
  66. vec<2, T, Q> const& v1,
  67. vec<2, T, Q> const& v2);
  68. //! Build a column major matrix from other matrix.
  69. //! From GLM_GTX_matrix_major_storage extension.
  70. template<typename T, qualifier Q>
  71. GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2(
  72. mat<2, 2, T, Q> const& m);
  73. //! Build a column major matrix from column vectors.
  74. //! From GLM_GTX_matrix_major_storage extension.
  75. template<typename T, qualifier Q>
  76. GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3(
  77. vec<3, T, Q> const& v1,
  78. vec<3, T, Q> const& v2,
  79. vec<3, T, Q> const& v3);
  80. //! Build a column major matrix from other matrix.
  81. //! From GLM_GTX_matrix_major_storage extension.
  82. template<typename T, qualifier Q>
  83. GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3(
  84. mat<3, 3, T, Q> const& m);
  85. //! Build a column major matrix from column vectors.
  86. //! From GLM_GTX_matrix_major_storage extension.
  87. template<typename T, qualifier Q>
  88. GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4(
  89. vec<4, T, Q> const& v1,
  90. vec<4, T, Q> const& v2,
  91. vec<4, T, Q> const& v3,
  92. vec<4, T, Q> const& v4);
  93. //! Build a column major matrix from other matrix.
  94. //! From GLM_GTX_matrix_major_storage extension.
  95. template<typename T, qualifier Q>
  96. GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4(
  97. mat<4, 4, T, Q> const& m);
  98. /// @}
  99. }//namespace glm
  100. #include "matrix_major_storage.inl"