matrix_major_storage.hpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  17. # ifndef GLM_ENABLE_EXPERIMENTAL
  18. # pragma message("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.")
  19. # else
  20. # pragma message("GLM: GLM_GTX_matrix_major_storage extension included")
  21. # endif
  22. #endif
  23. namespace glm
  24. {
  25. /// @addtogroup gtx_matrix_major_storage
  26. /// @{
  27. //! Build a row major matrix from row vectors.
  28. //! From GLM_GTX_matrix_major_storage extension.
  29. template<typename T, qualifier Q>
  30. GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2(
  31. vec<2, T, Q> const& v1,
  32. vec<2, T, Q> const& v2);
  33. //! Build a row major matrix from other matrix.
  34. //! From GLM_GTX_matrix_major_storage extension.
  35. template<typename T, qualifier Q>
  36. GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2(
  37. mat<2, 2, T, Q> const& m);
  38. //! Build a row major matrix from row vectors.
  39. //! From GLM_GTX_matrix_major_storage extension.
  40. template<typename T, qualifier Q>
  41. GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3(
  42. vec<3, T, Q> const& v1,
  43. vec<3, T, Q> const& v2,
  44. vec<3, T, Q> const& v3);
  45. //! Build a row major matrix from other matrix.
  46. //! From GLM_GTX_matrix_major_storage extension.
  47. template<typename T, qualifier Q>
  48. GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3(
  49. mat<3, 3, T, Q> const& m);
  50. //! Build a row major matrix from row vectors.
  51. //! From GLM_GTX_matrix_major_storage extension.
  52. template<typename T, qualifier Q>
  53. GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4(
  54. vec<4, T, Q> const& v1,
  55. vec<4, T, Q> const& v2,
  56. vec<4, T, Q> const& v3,
  57. vec<4, T, Q> const& v4);
  58. //! Build a row major matrix from other matrix.
  59. //! From GLM_GTX_matrix_major_storage extension.
  60. template<typename T, qualifier Q>
  61. GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4(
  62. mat<4, 4, T, Q> const& m);
  63. //! Build a column major matrix from column vectors.
  64. //! From GLM_GTX_matrix_major_storage extension.
  65. template<typename T, qualifier Q>
  66. GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2(
  67. vec<2, T, Q> const& v1,
  68. vec<2, T, Q> const& v2);
  69. //! Build a column major matrix from other matrix.
  70. //! From GLM_GTX_matrix_major_storage extension.
  71. template<typename T, qualifier Q>
  72. GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2(
  73. mat<2, 2, T, Q> const& m);
  74. //! Build a column major matrix from column vectors.
  75. //! From GLM_GTX_matrix_major_storage extension.
  76. template<typename T, qualifier Q>
  77. GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3(
  78. vec<3, T, Q> const& v1,
  79. vec<3, T, Q> const& v2,
  80. vec<3, T, Q> const& v3);
  81. //! Build a column major matrix from other matrix.
  82. //! From GLM_GTX_matrix_major_storage extension.
  83. template<typename T, qualifier Q>
  84. GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3(
  85. mat<3, 3, T, Q> const& m);
  86. //! Build a column major matrix from column vectors.
  87. //! From GLM_GTX_matrix_major_storage extension.
  88. template<typename T, qualifier Q>
  89. GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4(
  90. vec<4, T, Q> const& v1,
  91. vec<4, T, Q> const& v2,
  92. vec<4, T, Q> const& v3,
  93. vec<4, T, Q> const& v4);
  94. //! Build a column major matrix from other matrix.
  95. //! From GLM_GTX_matrix_major_storage extension.
  96. template<typename T, qualifier Q>
  97. GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4(
  98. mat<4, 4, T, Q> const& m);
  99. /// @}
  100. }//namespace glm
  101. #include "matrix_major_storage.inl"