Clutter Engine 0.0.1
Loading...
Searching...
No Matches
type_mat4x2.inl
1namespace glm
2{
3 // -- Constructors --
4
5# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
6 template<typename T, qualifier Q>
7 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat()
8# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
9 : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)}
10# endif
11 {
12# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION
13 this->value[0] = col_type(1, 0);
14 this->value[1] = col_type(0, 1);
15 this->value[2] = col_type(0, 0);
16 this->value[3] = col_type(0, 0);
17# endif
18 }
19# endif
20
21 template<typename T, qualifier Q>
22 template<qualifier P>
23 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m)
24# if GLM_HAS_INITIALIZER_LISTS
25 : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])}
26# endif
27 {
28# if !GLM_HAS_INITIALIZER_LISTS
29 this->value[0] = m[0];
30 this->value[1] = m[1];
31 this->value[2] = m[2];
32 this->value[3] = m[3];
33# endif
34 }
35
36 template<typename T, qualifier Q>
37 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(T s)
38# if GLM_HAS_INITIALIZER_LISTS
39 : value{col_type(s, 0), col_type(0, s), col_type(0, 0), col_type(0, 0)}
40# endif
41 {
42# if !GLM_HAS_INITIALIZER_LISTS
43 this->value[0] = col_type(s, 0);
44 this->value[1] = col_type(0, s);
45 this->value[2] = col_type(0, 0);
46 this->value[3] = col_type(0, 0);
47# endif
48 }
49
50 template<typename T, qualifier Q>
51 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat
52 (
53 T x0, T y0,
54 T x1, T y1,
55 T x2, T y2,
56 T x3, T y3
57 )
58# if GLM_HAS_INITIALIZER_LISTS
59 : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)}
60# endif
61 {
62# if !GLM_HAS_INITIALIZER_LISTS
63 this->value[0] = col_type(x0, y0);
64 this->value[1] = col_type(x1, y1);
65 this->value[2] = col_type(x2, y2);
66 this->value[3] = col_type(x3, y3);
67# endif
68 }
69
70 template<typename T, qualifier Q>
71 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3)
72# if GLM_HAS_INITIALIZER_LISTS
73 : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)}
74# endif
75 {
76# if !GLM_HAS_INITIALIZER_LISTS
77 this->value[0] = v0;
78 this->value[1] = v1;
79 this->value[2] = v2;
80 this->value[3] = v3;
81# endif
82 }
83
84 // -- Conversion constructors --
85
86 template<typename T, qualifier Q>
87 template<
88 typename X0, typename Y0,
89 typename X1, typename Y1,
90 typename X2, typename Y2,
91 typename X3, typename Y3>
92 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat
93 (
94 X0 x0, Y0 y0,
95 X1 x1, Y1 y1,
96 X2 x2, Y2 y2,
97 X3 x3, Y3 y3
98 )
99# if GLM_HAS_INITIALIZER_LISTS
100 : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)}
101# endif
102 {
103# if !GLM_HAS_INITIALIZER_LISTS
104 this->value[0] = col_type(x0, y0);
105 this->value[1] = col_type(x1, y1);
106 this->value[2] = col_type(x2, y2);
107 this->value[3] = col_type(x3, y3);
108# endif
109 }
110
111 template<typename T, qualifier Q>
112 template<typename V0, typename V1, typename V2, typename V3>
113 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3)
114# if GLM_HAS_INITIALIZER_LISTS
115 : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)}
116# endif
117 {
118# if !GLM_HAS_INITIALIZER_LISTS
119 this->value[0] = col_type(v0);
120 this->value[1] = col_type(v1);
121 this->value[2] = col_type(v2);
122 this->value[3] = col_type(v3);
123# endif
124 }
125
126 // -- Conversion --
127
128 template<typename T, qualifier Q>
129 template<typename U, qualifier P>
130 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m)
131# if GLM_HAS_INITIALIZER_LISTS
132 : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])}
133# endif
134 {
135# if !GLM_HAS_INITIALIZER_LISTS
136 this->value[0] = col_type(m[0]);
137 this->value[1] = col_type(m[1]);
138 this->value[2] = col_type(m[2]);
139 this->value[3] = col_type(m[3]);
140# endif
141 }
142
143 template<typename T, qualifier Q>
144 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m)
145# if GLM_HAS_INITIALIZER_LISTS
146 : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)}
147# endif
148 {
149# if !GLM_HAS_INITIALIZER_LISTS
150 this->value[0] = col_type(m[0]);
151 this->value[1] = col_type(m[1]);
152 this->value[2] = col_type(0);
153 this->value[3] = col_type(0);
154# endif
155 }
156
157 template<typename T, qualifier Q>
158 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m)
159# if GLM_HAS_INITIALIZER_LISTS
160 : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)}
161# endif
162 {
163# if !GLM_HAS_INITIALIZER_LISTS
164 this->value[0] = col_type(m[0]);
165 this->value[1] = col_type(m[1]);
166 this->value[2] = col_type(m[2]);
167 this->value[3] = col_type(0);
168# endif
169 }
170
171 template<typename T, qualifier Q>
172 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m)
173# if GLM_HAS_INITIALIZER_LISTS
174 : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])}
175# endif
176 {
177# if !GLM_HAS_INITIALIZER_LISTS
178 this->value[0] = col_type(m[0]);
179 this->value[1] = col_type(m[1]);
180 this->value[2] = col_type(m[2]);
181 this->value[3] = col_type(m[3]);
182# endif
183 }
184
185 template<typename T, qualifier Q>
186 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m)
187# if GLM_HAS_INITIALIZER_LISTS
188 : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)}
189# endif
190 {
191# if !GLM_HAS_INITIALIZER_LISTS
192 this->value[0] = col_type(m[0]);
193 this->value[1] = col_type(m[1]);
194 this->value[2] = col_type(0);
195 this->value[3] = col_type(0);
196# endif
197 }
198
199 template<typename T, qualifier Q>
200 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m)
201# if GLM_HAS_INITIALIZER_LISTS
202 : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)}
203# endif
204 {
205# if !GLM_HAS_INITIALIZER_LISTS
206 this->value[0] = col_type(m[0]);
207 this->value[1] = col_type(m[1]);
208 this->value[2] = col_type(m[2]);
209 this->value[3] = col_type(0);
210# endif
211 }
212
213 template<typename T, qualifier Q>
214 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m)
215# if GLM_HAS_INITIALIZER_LISTS
216 : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)}
217# endif
218 {
219# if !GLM_HAS_INITIALIZER_LISTS
220 this->value[0] = col_type(m[0]);
221 this->value[1] = col_type(m[1]);
222 this->value[2] = col_type(0);
223 this->value[3] = col_type(0);
224# endif
225 }
226
227 template<typename T, qualifier Q>
228 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m)
229# if GLM_HAS_INITIALIZER_LISTS
230 : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])}
231# endif
232 {
233# if !GLM_HAS_INITIALIZER_LISTS
234 this->value[0] = col_type(m[0]);
235 this->value[1] = col_type(m[1]);
236 this->value[2] = col_type(m[2]);
237 this->value[3] = col_type(m[3]);
238# endif
239 }
240
241 template<typename T, qualifier Q>
242 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m)
243# if GLM_HAS_INITIALIZER_LISTS
244 : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)}
245# endif
246 {
247# if !GLM_HAS_INITIALIZER_LISTS
248 this->value[0] = col_type(m[0]);
249 this->value[1] = col_type(m[1]);
250 this->value[2] = col_type(m[2]);
251 this->value[3] = col_type(0);
252# endif
253 }
254
255 // -- Accesses --
256
257 template<typename T, qualifier Q>
258 GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type & mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i)
259 {
260 assert(i < this->length());
261 return this->value[i];
262 }
263
264 template<typename T, qualifier Q>
265 GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type const& mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) const
266 {
267 assert(i < this->length());
268 return this->value[i];
269 }
270
271 // -- Unary updatable operators --
272
273 template<typename T, qualifier Q>
274 template<typename U>
275 GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m)
276 {
277 this->value[0] = m[0];
278 this->value[1] = m[1];
279 this->value[2] = m[2];
280 this->value[3] = m[3];
281 return *this;
282 }
283
284 template<typename T, qualifier Q>
285 template<typename U>
286 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s)
287 {
288 this->value[0] += s;
289 this->value[1] += s;
290 this->value[2] += s;
291 this->value[3] += s;
292 return *this;
293 }
294
295 template<typename T, qualifier Q>
296 template<typename U>
297 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m)
298 {
299 this->value[0] += m[0];
300 this->value[1] += m[1];
301 this->value[2] += m[2];
302 this->value[3] += m[3];
303 return *this;
304 }
305
306 template<typename T, qualifier Q>
307 template<typename U>
308 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s)
309 {
310 this->value[0] -= s;
311 this->value[1] -= s;
312 this->value[2] -= s;
313 this->value[3] -= s;
314 return *this;
315 }
316
317 template<typename T, qualifier Q>
318 template<typename U>
319 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m)
320 {
321 this->value[0] -= m[0];
322 this->value[1] -= m[1];
323 this->value[2] -= m[2];
324 this->value[3] -= m[3];
325 return *this;
326 }
327
328 template<typename T, qualifier Q>
329 template<typename U>
330 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s)
331 {
332 this->value[0] *= s;
333 this->value[1] *= s;
334 this->value[2] *= s;
335 this->value[3] *= s;
336 return *this;
337 }
338
339 template<typename T, qualifier Q>
340 template<typename U>
341 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s)
342 {
343 this->value[0] /= s;
344 this->value[1] /= s;
345 this->value[2] /= s;
346 this->value[3] /= s;
347 return *this;
348 }
349
350 // -- Increment and decrement operators --
351
352 template<typename T, qualifier Q>
353 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++()
354 {
355 ++this->value[0];
356 ++this->value[1];
357 ++this->value[2];
358 ++this->value[3];
359 return *this;
360 }
361
362 template<typename T, qualifier Q>
363 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--()
364 {
365 --this->value[0];
366 --this->value[1];
367 --this->value[2];
368 --this->value[3];
369 return *this;
370 }
371
372 template<typename T, qualifier Q>
373 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int)
374 {
375 mat<4, 2, T, Q> Result(*this);
376 ++*this;
377 return Result;
378 }
379
380 template<typename T, qualifier Q>
381 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int)
382 {
383 mat<4, 2, T, Q> Result(*this);
384 --*this;
385 return Result;
386 }
387
388 // -- Unary arithmetic operators --
389
390 template<typename T, qualifier Q>
391 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m)
392 {
393 return m;
394 }
395
396 template<typename T, qualifier Q>
397 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m)
398 {
399 return mat<4, 2, T, Q>(
400 -m[0],
401 -m[1],
402 -m[2],
403 -m[3]);
404 }
405
406 // -- Binary arithmetic operators --
407
408 template<typename T, qualifier Q>
409 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar)
410 {
411 return mat<4, 2, T, Q>(
412 m[0] + scalar,
413 m[1] + scalar,
414 m[2] + scalar,
415 m[3] + scalar);
416 }
417
418 template<typename T, qualifier Q>
419 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
420 {
421 return mat<4, 2, T, Q>(
422 m1[0] + m2[0],
423 m1[1] + m2[1],
424 m1[2] + m2[2],
425 m1[3] + m2[3]);
426 }
427
428 template<typename T, qualifier Q>
429 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar)
430 {
431 return mat<4, 2, T, Q>(
432 m[0] - scalar,
433 m[1] - scalar,
434 m[2] - scalar,
435 m[3] - scalar);
436 }
437
438 template<typename T, qualifier Q>
439 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
440 {
441 return mat<4, 2, T, Q>(
442 m1[0] - m2[0],
443 m1[1] - m2[1],
444 m1[2] - m2[2],
445 m1[3] - m2[3]);
446 }
447
448 template<typename T, qualifier Q>
449 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar)
450 {
451 return mat<4, 2, T, Q>(
452 m[0] * scalar,
453 m[1] * scalar,
454 m[2] * scalar,
455 m[3] * scalar);
456 }
457
458 template<typename T, qualifier Q>
459 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m)
460 {
461 return mat<4, 2, T, Q>(
462 m[0] * scalar,
463 m[1] * scalar,
464 m[2] * scalar,
465 m[3] * scalar);
466 }
467
468 template<typename T, qualifier Q>
469 GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v)
470 {
471 return typename mat<4, 2, T, Q>::col_type(
472 m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
473 m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);
474 }
475
476 template<typename T, qualifier Q>
477 GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m)
478 {
479 return typename mat<4, 2, T, Q>::row_type(
480 v.x * m[0][0] + v.y * m[0][1],
481 v.x * m[1][0] + v.y * m[1][1],
482 v.x * m[2][0] + v.y * m[2][1],
483 v.x * m[3][0] + v.y * m[3][1]);
484 }
485
486 template<typename T, qualifier Q>
487 GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
488 {
489 T const SrcA00 = m1[0][0];
490 T const SrcA01 = m1[0][1];
491 T const SrcA10 = m1[1][0];
492 T const SrcA11 = m1[1][1];
493 T const SrcA20 = m1[2][0];
494 T const SrcA21 = m1[2][1];
495 T const SrcA30 = m1[3][0];
496 T const SrcA31 = m1[3][1];
497
498 T const SrcB00 = m2[0][0];
499 T const SrcB01 = m2[0][1];
500 T const SrcB02 = m2[0][2];
501 T const SrcB03 = m2[0][3];
502 T const SrcB10 = m2[1][0];
503 T const SrcB11 = m2[1][1];
504 T const SrcB12 = m2[1][2];
505 T const SrcB13 = m2[1][3];
506
507 mat<2, 2, T, Q> Result;
508 Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
509 Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
510 Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
511 Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;
512 return Result;
513 }
514
515 template<typename T, qualifier Q>
516 GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
517 {
518 return mat<3, 2, T, Q>(
519 m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
520 m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
521 m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
522 m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
523 m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
524 m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]);
525 }
526
527 template<typename T, qualifier Q>
528 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
529 {
530 return mat<4, 2, T, Q>(
531 m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
532 m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
533 m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
534 m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
535 m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
536 m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3],
537 m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3],
538 m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]);
539 }
540
541 template<typename T, qualifier Q>
542 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar)
543 {
544 return mat<4, 2, T, Q>(
545 m[0] / scalar,
546 m[1] / scalar,
547 m[2] / scalar,
548 m[3] / scalar);
549 }
550
551 template<typename T, qualifier Q>
552 GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m)
553 {
554 return mat<4, 2, T, Q>(
555 scalar / m[0],
556 scalar / m[1],
557 scalar / m[2],
558 scalar / m[3]);
559 }
560
561 // -- Boolean operators --
562
563 template<typename T, qualifier Q>
564 GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
565 {
566 return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
567 }
568
569 template<typename T, qualifier Q>
570 GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
571 {
572 return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
573 }
574} //namespace glm
Core features
Definition common.hpp:21