1 /// @ref core 2 /// @file glm/detail/type_mat2x3.hpp 3 4 #pragma once 5 6 #include "../fwd.hpp" 7 #include "type_vec2.hpp" 8 #include "type_vec3.hpp" 9 #include "type_mat.hpp" 10 #include <limits> 11 #include <cstddef> 12 13 namespace glm 14 { 15 template <typename T, precision P = defaultp> 16 struct tmat2x3 17 { 18 typedef tvec3<T, P> col_type; 19 typedef tvec2<T, P> row_type; 20 typedef tmat2x3<T, P> type; 21 typedef tmat3x2<T, P> transpose_type; 22 typedef T value_type; 23 24 private: 25 col_type value[2]; 26 27 public: 28 // -- Constructors -- 29 30 GLM_FUNC_DECL tmat2x3() GLM_DEFAULT_CTOR; 31 GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m) GLM_DEFAULT; 32 template <precision Q> 33 GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m); 34 35 GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat2x3(ctor); 36 GLM_FUNC_DECL explicit tmat2x3(T scalar); 37 GLM_FUNC_DECL tmat2x3( 38 T x0, T y0, T z0, 39 T x1, T y1, T z1); 40 GLM_FUNC_DECL tmat2x3( 41 col_type const & v0, 42 col_type const & v1); 43 44 // -- Conversions -- 45 46 template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> 47 GLM_FUNC_DECL tmat2x3( 48 X1 x1, Y1 y1, Z1 z1, 49 X2 x2, Y2 y2, Z2 z2); 50 51 template <typename U, typename V> 52 GLM_FUNC_DECL tmat2x3( 53 tvec3<U, P> const & v1, 54 tvec3<V, P> const & v2); 55 56 // -- Matrix conversions -- 57 58 template <typename U, precision Q> 59 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x3<U, Q> const & m); 60 61 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x2<T, P> const & x); 62 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x3<T, P> const & x); 63 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x4<T, P> const & x); 64 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x4<T, P> const & x); 65 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x2<T, P> const & x); 66 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x4<T, P> const & x); 67 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x2<T, P> const & x); 68 GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x3<T, P> const & x); 69 70 // -- Accesses -- 71 72 typedef length_t length_type; lengthglm::tmat2x373 GLM_FUNC_DECL static length_type length(){return 2;} 74 75 GLM_FUNC_DECL col_type & operator[](length_type i); 76 GLM_FUNC_DECL col_type const & operator[](length_type i) const; 77 78 // -- Unary arithmetic operators -- 79 80 GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> const & m) GLM_DEFAULT; 81 82 template <typename U> 83 GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<U, P> const & m); 84 template <typename U> 85 GLM_FUNC_DECL tmat2x3<T, P> & operator+=(U s); 86 template <typename U> 87 GLM_FUNC_DECL tmat2x3<T, P> & operator+=(tmat2x3<U, P> const & m); 88 template <typename U> 89 GLM_FUNC_DECL tmat2x3<T, P> & operator-=(U s); 90 template <typename U> 91 GLM_FUNC_DECL tmat2x3<T, P> & operator-=(tmat2x3<U, P> const & m); 92 template <typename U> 93 GLM_FUNC_DECL tmat2x3<T, P> & operator*=(U s); 94 template <typename U> 95 GLM_FUNC_DECL tmat2x3<T, P> & operator/=(U s); 96 97 // -- Increment and decrement operators -- 98 99 GLM_FUNC_DECL tmat2x3<T, P> & operator++ (); 100 GLM_FUNC_DECL tmat2x3<T, P> & operator-- (); 101 GLM_FUNC_DECL tmat2x3<T, P> operator++(int); 102 GLM_FUNC_DECL tmat2x3<T, P> operator--(int); 103 }; 104 105 // -- Unary operators -- 106 107 template <typename T, precision P> 108 GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m); 109 110 template <typename T, precision P> 111 GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m); 112 113 // -- Binary operators -- 114 115 template <typename T, precision P> 116 GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T scalar); 117 118 template <typename T, precision P> 119 GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2); 120 121 template <typename T, precision P> 122 GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T scalar); 123 124 template <typename T, precision P> 125 GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2); 126 127 template <typename T, precision P> 128 GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T scalar); 129 130 template <typename T, precision P> 131 GLM_FUNC_DECL tmat2x3<T, P> operator*(T scalar, tmat2x3<T, P> const & m); 132 133 template <typename T, precision P> 134 GLM_FUNC_DECL typename tmat2x3<T, P>::col_type operator*(tmat2x3<T, P> const & m, typename tmat2x3<T, P>::row_type const & v); 135 136 template <typename T, precision P> 137 GLM_FUNC_DECL typename tmat2x3<T, P>::row_type operator*(typename tmat2x3<T, P>::col_type const & v, tmat2x3<T, P> const & m); 138 139 template <typename T, precision P> 140 GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2); 141 142 template <typename T, precision P> 143 GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2); 144 145 template <typename T, precision P> 146 GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2); 147 148 template <typename T, precision P> 149 GLM_FUNC_DECL tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T scalar); 150 151 template <typename T, precision P> 152 GLM_FUNC_DECL tmat2x3<T, P> operator/(T scalar, tmat2x3<T, P> const & m); 153 154 // -- Boolean operators -- 155 156 template <typename T, precision P> 157 GLM_FUNC_DECL bool operator==(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2); 158 159 template <typename T, precision P> 160 GLM_FUNC_DECL bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2); 161 }//namespace glm 162 163 #ifndef GLM_EXTERNAL_TEMPLATE 164 #include "type_mat2x3.inl" 165 #endif 166