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 /// @brief Build matrices with specific matrix order, row or column 11 /// 12 /// <glm/gtx/matrix_major_storage.hpp> need to be included to use these functionalities. 13 14 #pragma once 15 16 // Dependency: 17 #include "../glm.hpp" 18 19 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 # pragma message("GLM: GLM_GTX_matrix_major_storage extension included") 21 #endif 22 23 namespace glm 24 { 25 /// @addtogroup gtx_matrix_major_storage 26 /// @{ 27 28 //! Build a row major matrix from row vectors. 29 //! From GLM_GTX_matrix_major_storage extension. 30 template <typename T, precision P> 31 GLM_FUNC_DECL tmat2x2<T, P> rowMajor2( 32 tvec2<T, P> const & v1, 33 tvec2<T, P> const & v2); 34 35 //! Build a row major matrix from other matrix. 36 //! From GLM_GTX_matrix_major_storage extension. 37 template <typename T, precision P> 38 GLM_FUNC_DECL tmat2x2<T, P> rowMajor2( 39 tmat2x2<T, P> const & m); 40 41 //! Build a row major matrix from row vectors. 42 //! From GLM_GTX_matrix_major_storage extension. 43 template <typename T, precision P> 44 GLM_FUNC_DECL tmat3x3<T, P> rowMajor3( 45 tvec3<T, P> const & v1, 46 tvec3<T, P> const & v2, 47 tvec3<T, P> const & v3); 48 49 //! Build a row major matrix from other matrix. 50 //! From GLM_GTX_matrix_major_storage extension. 51 template <typename T, precision P> 52 GLM_FUNC_DECL tmat3x3<T, P> rowMajor3( 53 tmat3x3<T, P> const & m); 54 55 //! Build a row major matrix from row vectors. 56 //! From GLM_GTX_matrix_major_storage extension. 57 template <typename T, precision P> 58 GLM_FUNC_DECL tmat4x4<T, P> rowMajor4( 59 tvec4<T, P> const & v1, 60 tvec4<T, P> const & v2, 61 tvec4<T, P> const & v3, 62 tvec4<T, P> const & v4); 63 64 //! Build a row major matrix from other matrix. 65 //! From GLM_GTX_matrix_major_storage extension. 66 template <typename T, precision P> 67 GLM_FUNC_DECL tmat4x4<T, P> rowMajor4( 68 tmat4x4<T, P> const & m); 69 70 //! Build a column major matrix from column vectors. 71 //! From GLM_GTX_matrix_major_storage extension. 72 template <typename T, precision P> 73 GLM_FUNC_DECL tmat2x2<T, P> colMajor2( 74 tvec2<T, P> const & v1, 75 tvec2<T, P> const & v2); 76 77 //! Build a column major matrix from other matrix. 78 //! From GLM_GTX_matrix_major_storage extension. 79 template <typename T, precision P> 80 GLM_FUNC_DECL tmat2x2<T, P> colMajor2( 81 tmat2x2<T, P> const & m); 82 83 //! Build a column major matrix from column vectors. 84 //! From GLM_GTX_matrix_major_storage extension. 85 template <typename T, precision P> 86 GLM_FUNC_DECL tmat3x3<T, P> colMajor3( 87 tvec3<T, P> const & v1, 88 tvec3<T, P> const & v2, 89 tvec3<T, P> const & v3); 90 91 //! Build a column major matrix from other matrix. 92 //! From GLM_GTX_matrix_major_storage extension. 93 template <typename T, precision P> 94 GLM_FUNC_DECL tmat3x3<T, P> colMajor3( 95 tmat3x3<T, P> const & m); 96 97 //! Build a column major matrix from column vectors. 98 //! From GLM_GTX_matrix_major_storage extension. 99 template <typename T, precision P> 100 GLM_FUNC_DECL tmat4x4<T, P> colMajor4( 101 tvec4<T, P> const & v1, 102 tvec4<T, P> const & v2, 103 tvec4<T, P> const & v3, 104 tvec4<T, P> const & v4); 105 106 //! Build a column major matrix from other matrix. 107 //! From GLM_GTX_matrix_major_storage extension. 108 template <typename T, precision P> 109 GLM_FUNC_DECL tmat4x4<T, P> colMajor4( 110 tmat4x4<T, P> const & m); 111 112 /// @} 113 }//namespace glm 114 115 #include "matrix_major_storage.inl" 116