29 #ifndef glm_core_type_mat2x2
30 #define glm_core_type_mat2x2
33 #include "type_vec2.hpp"
34 #include "type_mat.hpp"
40 template <
typename T, precision P>
45 typedef std::size_t size_type;
46 typedef tvec2<T, P> col_type;
47 typedef tvec2<T, P> row_type;
48 typedef tmat2x2<T, P> type;
49 typedef tmat2x2<T, P> transpose_type;
51 GLM_FUNC_DECL GLM_CONSTEXPR length_t
length()
const;
53 template <
typename U, precision Q>
54 friend tmat2x2<U, Q>
inverse(tmat2x2<U, Q>
const & m);
55 template <
typename U, precision Q>
56 friend tvec2<U, Q> operator/(tmat2x2<U, Q>
const & m, tvec2<U, Q>
const & v);
57 template <
typename U, precision Q>
58 friend tvec2<U, Q> operator/(tvec2<U, Q>
const & v, tmat2x2<U, Q>
const & m);
64 GLM_FUNC_DECL tmat2x2<T, P> _inverse()
const;
70 GLM_FUNC_DECL tmat2x2();
71 GLM_FUNC_DECL tmat2x2(tmat2x2<T, P>
const & m);
72 template <precision Q>
73 GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q>
const & m);
75 GLM_FUNC_DECL
explicit tmat2x2(
77 GLM_FUNC_DECL
explicit tmat2x2(
79 GLM_FUNC_DECL
explicit tmat2x2(
80 T
const & x1, T
const & y1,
81 T
const & x2, T
const & y2);
82 GLM_FUNC_DECL
explicit tmat2x2(
86 #if(GLM_HAS_INITIALIZER_LISTS)
88 GLM_FUNC_DECL tmat2x2(std::initializer_list<U> m);
90 GLM_FUNC_DECL tmat2x2(std::initializer_list<tvec2<T, P> > m);
91 #endif//GLM_HAS_INITIALIZER_LISTS
96 GLM_FUNC_DECL
explicit tmat2x2(
99 template <
typename U,
typename V,
typename M,
typename N>
100 GLM_FUNC_DECL
explicit tmat2x2(
101 U
const & x1, V
const & y1,
102 M
const & x2, N
const & y2);
104 template <
typename U,
typename V>
105 GLM_FUNC_DECL
explicit tmat2x2(
106 tvec2<U, P>
const & v1,
107 tvec2<V, P>
const & v2);
111 template <
typename U, precision Q>
112 GLM_FUNC_DECL
explicit tmat2x2(tmat2x2<U, Q>
const & m);
114 GLM_FUNC_DECL
explicit tmat2x2(tmat3x3<T, P>
const & x);
115 GLM_FUNC_DECL
explicit tmat2x2(tmat4x4<T, P>
const & x);
116 GLM_FUNC_DECL
explicit tmat2x2(tmat2x3<T, P>
const & x);
117 GLM_FUNC_DECL
explicit tmat2x2(tmat3x2<T, P>
const & x);
118 GLM_FUNC_DECL
explicit tmat2x2(tmat2x4<T, P>
const & x);
119 GLM_FUNC_DECL
explicit tmat2x2(tmat4x2<T, P>
const & x);
120 GLM_FUNC_DECL
explicit tmat2x2(tmat3x4<T, P>
const & x);
121 GLM_FUNC_DECL
explicit tmat2x2(tmat4x3<T, P>
const & x);
126 GLM_FUNC_DECL col_type & operator[](length_t i);
127 GLM_FUNC_DECL col_type
const & operator[](length_t i)
const;
130 GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P>
const & m);
131 template <
typename U>
132 GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P>
const & m);
133 template <
typename U>
134 GLM_FUNC_DECL tmat2x2<T, P> & operator+=(U s);
135 template <
typename U>
136 GLM_FUNC_DECL tmat2x2<T, P> & operator+=(tmat2x2<U, P>
const & m);
137 template <
typename U>
138 GLM_FUNC_DECL tmat2x2<T, P> & operator-=(U s);
139 template <
typename U>
140 GLM_FUNC_DECL tmat2x2<T, P> & operator-=(tmat2x2<U, P>
const & m);
141 template <
typename U>
142 GLM_FUNC_DECL tmat2x2<T, P> & operator*=(U s);
143 template <
typename U>
144 GLM_FUNC_DECL tmat2x2<T, P> & operator*=(tmat2x2<U, P>
const & m);
145 template <
typename U>
146 GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U s);
147 template <
typename U>
148 GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P>
const & m);
153 GLM_FUNC_DECL tmat2x2<T, P> & operator++ ();
154 GLM_FUNC_DECL tmat2x2<T, P> & operator-- ();
155 GLM_FUNC_DECL tmat2x2<T, P> operator++(
int);
156 GLM_FUNC_DECL tmat2x2<T, P> operator--(
int);
161 template <
typename T, precision P>
162 GLM_FUNC_DECL tmat2x2<T, P> operator+ (
163 tmat2x2<T, P>
const & m,
166 template <
typename T, precision P>
167 GLM_FUNC_DECL tmat2x2<T, P> operator+ (
169 tmat2x2<T, P>
const & m);
171 template <
typename T, precision P>
172 GLM_FUNC_DECL tmat2x2<T, P> operator+ (
173 tmat2x2<T, P>
const & m1,
174 tmat2x2<T, P>
const & m2);
176 template <
typename T, precision P>
177 GLM_FUNC_DECL tmat2x2<T, P> operator- (
178 tmat2x2<T, P>
const & m,
181 template <
typename T, precision P>
182 GLM_FUNC_DECL tmat2x2<T, P> operator- (
184 tmat2x2<T, P>
const & m);
186 template <
typename T, precision P>
187 GLM_FUNC_DECL tmat2x2<T, P> operator- (
188 tmat2x2<T, P>
const & m1,
189 tmat2x2<T, P>
const & m2);
191 template <
typename T, precision P>
192 GLM_FUNC_DECL tmat2x2<T, P> operator* (
193 tmat2x2<T, P>
const & m,
196 template <
typename T, precision P>
197 GLM_FUNC_DECL tmat2x2<T, P> operator* (
199 tmat2x2<T, P>
const & m);
201 template <
typename T, precision P>
202 GLM_FUNC_DECL
typename tmat2x2<T, P>::col_type operator* (
203 tmat2x2<T, P>
const & m,
204 typename tmat2x2<T, P>::row_type
const & v);
206 template <
typename T, precision P>
207 GLM_FUNC_DECL
typename tmat2x2<T, P>::row_type operator* (
208 typename tmat2x2<T, P>::col_type
const & v,
209 tmat2x2<T, P>
const & m);
211 template <
typename T, precision P>
212 GLM_FUNC_DECL tmat2x2<T, P> operator* (
213 tmat2x2<T, P>
const & m1,
214 tmat2x2<T, P>
const & m2);
216 template <
typename T, precision P>
217 GLM_FUNC_DECL tmat3x2<T, P> operator* (
218 tmat2x2<T, P>
const & m1,
219 tmat3x2<T, P>
const & m2);
221 template <
typename T, precision P>
222 GLM_FUNC_DECL tmat4x2<T, P> operator* (
223 tmat2x2<T, P>
const & m1,
224 tmat4x2<T, P>
const & m2);
226 template <
typename T, precision P>
227 GLM_FUNC_DECL tmat2x2<T, P> operator/ (
228 tmat2x2<T, P>
const & m,
231 template <
typename T, precision P>
232 GLM_FUNC_DECL tmat2x2<T, P> operator/ (
234 tmat2x2<T, P>
const & m);
236 template <
typename T, precision P>
237 GLM_FUNC_DECL
typename tmat2x2<T, P>::col_type operator/ (
238 tmat2x2<T, P>
const & m,
239 typename tmat2x2<T, P>::row_type
const & v);
241 template <
typename T, precision P>
242 GLM_FUNC_DECL
typename tmat2x2<T, P>::row_type operator/ (
243 typename tmat2x2<T, P>::col_type
const & v,
244 tmat2x2<T, P>
const & m);
246 template <
typename T, precision P>
247 GLM_FUNC_DECL tmat2x2<T, P> operator/ (
248 tmat2x2<T, P>
const & m1,
249 tmat2x2<T, P>
const & m2);
252 template <
typename T, precision P>
253 GLM_FUNC_DECL tmat2x2<T, P>
const operator-(
254 tmat2x2<T, P>
const & m);
258 #ifndef GLM_EXTERNAL_TEMPLATE
259 #include "type_mat2x2.inl"
262 #endif //glm_core_type_mat2x2
GLM_FUNC_DECL genType::value_type length(genType const &x)
Returns the length of x, i.e., sqrt(x * x).
GLM_FUNC_DECL matType< T, P > inverse(matType< T, P > const &m)
Return the inverse of a squared matrix.