Clutter Engine 0.0.1
Loading...
Searching...
No Matches
type_mat4x3.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, 3, T, Q>::mat()
8# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
9 : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)}
10# endif
11 {
12# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION
13 this->value[0] = col_type(1, 0, 0);
14 this->value[1] = col_type(0, 1, 0);
15 this->value[2] = col_type(0, 0, 1);
16 this->value[3] = col_type(0, 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, 3, T, Q>::mat(mat<4, 3, 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, 3, T, Q>::mat(T const& s)
38# if GLM_HAS_INITIALIZER_LISTS
39 : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s), col_type(0, 0, 0)}
40# endif
41 {
42# if !GLM_HAS_INITIALIZER_LISTS
43 this->value[0] = col_type(s, 0, 0);
44 this->value[1] = col_type(0, s, 0);
45 this->value[2] = col_type(0, 0, s);
46 this->value[3] = col_type(0, 0, 0);
47# endif
48 }
49
50 template<typename T, qualifier Q>
51 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat
52 (
53 T const& x0, T const& y0, T const& z0,
54 T const& x1, T const& y1, T const& z1,
55 T const& x2, T const& y2, T const& z2,
56 T const& x3, T const& y3, T const& z3
57 )
58# if GLM_HAS_INITIALIZER_LISTS
59 : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)}
60# endif
61 {
62# if !GLM_HAS_INITIALIZER_LISTS
63 this->value[0] = col_type(x0, y0, z0);
64 this->value[1] = col_type(x1, y1, z1);
65 this->value[2] = col_type(x2, y2, z2);
66 this->value[3] = col_type(x3, y3, z3);
67# endif
68 }
69
70 template<typename T, qualifier Q>
71 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, 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, typename Z0,
89 typename X1, typename Y1, typename Z1,
90 typename X2, typename Y2, typename Z2,
91 typename X3, typename Y3, typename Z3>
92 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat
93 (
94 X0 const& x0, Y0 const& y0, Z0 const& z0,
95 X1 const& x1, Y1 const& y1, Z1 const& z1,
96 X2 const& x2, Y2 const& y2, Z2 const& z2,
97 X3 const& x3, Y3 const& y3, Z3 const& z3
98 )
99# if GLM_HAS_INITIALIZER_LISTS
100 : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)}
101# endif
102 {
103# if !GLM_HAS_INITIALIZER_LISTS
104 this->value[0] = col_type(x0, y0, z0);
105 this->value[1] = col_type(x1, y1, z1);
106 this->value[2] = col_type(x2, y2, z2);
107 this->value[3] = col_type(x3, y3, z3);
108# endif
109 }
110
111 template<typename T, qualifier Q>
112 template<typename V1, typename V2, typename V3, typename V4>
113 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, vec<3, V4, Q> const& v4)
114# if GLM_HAS_INITIALIZER_LISTS
115 : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)}
116# endif
117 {
118# if !GLM_HAS_INITIALIZER_LISTS
119 this->value[0] = col_type(v1);
120 this->value[1] = col_type(v2);
121 this->value[2] = col_type(v3);
122 this->value[3] = col_type(v4);
123# endif
124 }
125
126 // -- Matrix conversions --
127
128 template<typename T, qualifier Q>
129 template<typename U, qualifier P>
130 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, 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, 3, T, Q>::mat(mat<2, 2, T, Q> const& m)
145# if GLM_HAS_INITIALIZER_LISTS
146 : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1), col_type(0)}
147# endif
148 {
149# if !GLM_HAS_INITIALIZER_LISTS
150 this->value[0] = col_type(m[0], 0);
151 this->value[1] = col_type(m[1], 0);
152 this->value[2] = col_type(0, 0, 1);
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, 3, 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, 3, 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, 3, 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, 0, 1), 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, 0, 1);
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, 3, T, Q>::mat(mat<3, 2, T, Q> const& m)
201# if GLM_HAS_INITIALIZER_LISTS
202 : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(0)}
203# endif
204 {
205# if !GLM_HAS_INITIALIZER_LISTS
206 this->value[0] = col_type(m[0], 0);
207 this->value[1] = col_type(m[1], 0);
208 this->value[2] = col_type(m[2], 1);
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, 3, 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, 0, 1), 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, 0, 1);
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, 3, T, Q>::mat(mat<4, 2, T, Q> const& m)
229# if GLM_HAS_INITIALIZER_LISTS
230 : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(m[3], 0)}
231# endif
232 {
233# if !GLM_HAS_INITIALIZER_LISTS
234 this->value[0] = col_type(m[0], 0);
235 this->value[1] = col_type(m[1], 0);
236 this->value[2] = col_type(m[2], 1);
237 this->value[3] = col_type(m[3], 0);
238# endif
239 }
240
241 template<typename T, qualifier Q>
242 GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, 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, 3, T, Q>::col_type & mat<4, 3, T, Q>::operator[](typename mat<4, 3, 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, 3, T, Q>::col_type const& mat<4, 3, T, Q>::operator[](typename mat<4, 3, 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, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, 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, 3, T, Q> & mat<4, 3, 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, 3, T, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, 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, 3, T, Q> & mat<4, 3, 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, 3, T, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, 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, 3, T, Q> & mat<4, 3, 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, 3, T, Q> & mat<4, 3, 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, 3, T, Q> & mat<4, 3, 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, 3, T, Q> & mat<4, 3, 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, 3, T, Q> mat<4, 3, T, Q>::operator++(int)
374 {
375 mat<4, 3, T, Q> Result(*this);
376 ++*this;
377 return Result;
378 }
379
380 template<typename T, qualifier Q>
381 GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int)
382 {
383 mat<4, 3, 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, 3, T, Q> operator+(mat<4, 3, T, Q> const& m)
392 {
393 return m;
394 }
395
396 template<typename T, qualifier Q>
397 GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m)
398 {
399 return mat<4, 3, 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, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s)
410 {
411 return mat<4, 3, T, Q>(
412 m[0] + s,
413 m[1] + s,
414 m[2] + s,
415 m[3] + s);
416 }
417
418 template<typename T, qualifier Q>
419 GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
420 {
421 return mat<4, 3, 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, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s)
430 {
431 return mat<4, 3, T, Q>(
432 m[0] - s,
433 m[1] - s,
434 m[2] - s,
435 m[3] - s);
436 }
437
438 template<typename T, qualifier Q>
439 GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
440 {
441 return mat<4, 3, 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, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s)
450 {
451 return mat<4, 3, T, Q>(
452 m[0] * s,
453 m[1] * s,
454 m[2] * s,
455 m[3] * s);
456 }
457
458 template<typename T, qualifier Q>
459 GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m)
460 {
461 return mat<4, 3, T, Q>(
462 m[0] * s,
463 m[1] * s,
464 m[2] * s,
465 m[3] * s);
466 }
467
468 template<typename T, qualifier Q>
469 GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type operator*
470 (
471 mat<4, 3, T, Q> const& m,
472 typename mat<4, 3, T, Q>::row_type const& v)
473 {
474 return typename mat<4, 3, T, Q>::col_type(
475 m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
476 m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w,
477 m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w);
478 }
479
480 template<typename T, qualifier Q>
481 GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::row_type operator*
482 (
483 typename mat<4, 3, T, Q>::col_type const& v,
484 mat<4, 3, T, Q> const& m)
485 {
486 return typename mat<4, 3, T, Q>::row_type(
487 v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],
488 v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2],
489 v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2],
490 v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]);
491 }
492
493 template<typename T, qualifier Q>
494 GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
495 {
496 return mat<2, 3, T, Q>(
497 m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
498 m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
499 m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
500 m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
501 m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
502 m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]);
503 }
504
505 template<typename T, qualifier Q>
506 GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
507 {
508 T const SrcA00 = m1[0][0];
509 T const SrcA01 = m1[0][1];
510 T const SrcA02 = m1[0][2];
511 T const SrcA10 = m1[1][0];
512 T const SrcA11 = m1[1][1];
513 T const SrcA12 = m1[1][2];
514 T const SrcA20 = m1[2][0];
515 T const SrcA21 = m1[2][1];
516 T const SrcA22 = m1[2][2];
517 T const SrcA30 = m1[3][0];
518 T const SrcA31 = m1[3][1];
519 T const SrcA32 = m1[3][2];
520
521 T const SrcB00 = m2[0][0];
522 T const SrcB01 = m2[0][1];
523 T const SrcB02 = m2[0][2];
524 T const SrcB03 = m2[0][3];
525 T const SrcB10 = m2[1][0];
526 T const SrcB11 = m2[1][1];
527 T const SrcB12 = m2[1][2];
528 T const SrcB13 = m2[1][3];
529 T const SrcB20 = m2[2][0];
530 T const SrcB21 = m2[2][1];
531 T const SrcB22 = m2[2][2];
532 T const SrcB23 = m2[2][3];
533
534 mat<3, 3, T, Q> Result;
535 Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
536 Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
537 Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03;
538 Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
539 Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;
540 Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13;
541 Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23;
542 Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23;
543 Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23;
544 return Result;
545 }
546
547 template<typename T, qualifier Q>
548 GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
549 {
550 return mat<4, 3, T, Q>(
551 m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
552 m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
553 m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
554 m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
555 m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
556 m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3],
557 m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
558 m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3],
559 m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3],
560 m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3],
561 m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3],
562 m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]);
563 }
564
565 template<typename T, qualifier Q>
566 GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s)
567 {
568 return mat<4, 3, T, Q>(
569 m[0] / s,
570 m[1] / s,
571 m[2] / s,
572 m[3] / s);
573 }
574
575 template<typename T, qualifier Q>
576 GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m)
577 {
578 return mat<4, 3, T, Q>(
579 s / m[0],
580 s / m[1],
581 s / m[2],
582 s / m[3]);
583 }
584
585 // -- Boolean operators --
586
587 template<typename T, qualifier Q>
588 GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
589 {
590 return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
591 }
592
593 template<typename T, qualifier Q>
594 GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
595 {
596 return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
597 }
598} //namespace glm
Core features
Definition common.hpp:21