1 #ifndef SDK_MATRIX_BASE_TYPES_H_
11 #define SDK_MATRIX_BASE_TYPES_H_
13 #if defined(__clang__) || defined(__GNUC__)
14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wmissing-braces"
44 typedef float coordinate_type;
73 typedef float coordinate_type;
94 float _11, _12, _13, _14;
95 float _21, _22, _23, _24;
96 float _31, _32, _33, _34;
97 float _41, _42, _43, _44;
103 typedef float coordinate_type;
131 typedef double coordinate_type;
152 double _11, _12, _13;
153 double _21, _22, _23;
154 double _31, _32, _33;
160 typedef double coordinate_type;
181 double _11, _12, _13, _14;
182 double _21, _22, _23, _24;
183 double _31, _32, _33, _34;
184 double _41, _42, _43, _44;
190 typedef double coordinate_type;
207 #if 1 || SDKMatrixF3X2
209 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
210 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
211 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
215 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
216 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
217 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
221 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
222 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
223 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
227 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
228 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
229 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
233 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
234 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
235 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
247 inline SDKMatrixF3X2::operator
SDKMatrixD3X2() const noexcept {
250 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
251 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
252 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
256 inline SDKMatrixF3X2::operator
SDKMatrixF3X3() const noexcept {
259 M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0,
260 M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0,
261 M::coordinate_type(this->_31), M::coordinate_type(this->_32), 1,
265 inline SDKMatrixF3X2::operator
SDKMatrixD3X3() const noexcept {
268 M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0,
269 M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0,
270 M::coordinate_type(this->_31), M::coordinate_type(this->_32), 1,
274 inline SDKMatrixF3X2::operator
SDKMatrixF4X4() const noexcept {
277 M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0, 0,
278 M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0, 0,
279 M::coordinate_type(this->_31), M::coordinate_type(this->_32), 0, 0,
284 inline SDKMatrixF3X2::operator
SDKMatrixD4X4() const noexcept {
287 M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0, 0,
288 M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0, 0,
289 M::coordinate_type(this->_31), M::coordinate_type(this->_32), 0, 0,
296 #if 1 || SDKMatrixF3X3
298 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0;
299 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0;
300 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1;
304 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0;
305 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0;
306 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1;
310 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
311 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
312 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
316 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
317 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
318 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
322 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
323 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
324 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
327 inline SDKMatrixF3X3::operator
SDKMatrixF3X2() const noexcept {
330 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
331 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
332 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
336 inline SDKMatrixF3X3::operator
SDKMatrixD3X2() const noexcept {
339 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
340 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
341 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
354 inline SDKMatrixF3X3::operator
SDKMatrixD3X3() const noexcept {
357 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
358 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
359 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
363 inline SDKMatrixF3X3::operator
SDKMatrixF4X4() const noexcept {
366 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), 0,
367 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), 0,
368 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), 0,
373 inline SDKMatrixF3X3::operator
SDKMatrixD4X4() const noexcept {
376 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), 0,
377 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), 0,
378 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), 0,
385 #if 1 || SDKMatrixF4X4
387 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0, this->_14 = 0;
388 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0, this->_24 = 0;
389 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1, this->_34 = 0;
390 this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
394 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0, this->_14 = 0;
395 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0, this->_24 = 0;
396 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1, this->_34 = 0;
397 this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
401 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13), this->_14 = 0;
402 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23), this->_24 = 0;
403 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33), this->_34 = 0;
404 this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
408 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13), this->_14 = 0;
409 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23), this->_24 = 0;
410 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33), this->_34 = 0;
411 this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
415 for (
int row = 0; row < 4; ++row) {
416 this->_m[row][0] = coordinate_type(m._m[row][0]);
417 this->_m[row][1] = coordinate_type(m._m[row][1]);
418 this->_m[row][2] = coordinate_type(m._m[row][2]);
419 this->_m[row][3] = coordinate_type(m._m[row][3]);
423 inline SDKMatrixF4X4::operator
SDKMatrixF3X2() const noexcept {
426 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
427 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
428 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
432 inline SDKMatrixF4X4::operator
SDKMatrixD3X2() const noexcept {
435 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
436 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
437 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
441 inline SDKMatrixF4X4::operator
SDKMatrixF3X3() const noexcept {
444 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
445 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
446 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
450 inline SDKMatrixF4X4::operator
SDKMatrixD3X3() const noexcept {
453 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
454 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
455 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
469 inline SDKMatrixF4X4::operator
SDKMatrixD4X4() const noexcept {
472 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), M::coordinate_type(this->_14),
473 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), M::coordinate_type(this->_24),
474 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), M::coordinate_type(this->_34),
475 M::coordinate_type(this->_41), M::coordinate_type(this->_42), M::coordinate_type(this->_43), M::coordinate_type(this->_44),
481 #if 1 || SDKMatrixD3X2
483 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
484 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
485 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
489 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
490 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
491 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
495 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
496 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
497 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
501 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
502 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
503 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
507 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12);
508 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22);
509 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32);
512 inline SDKMatrixD3X2::operator
SDKMatrixF3X2() const noexcept {
515 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
516 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
517 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
530 inline SDKMatrixD3X2::operator
SDKMatrixF3X3() const noexcept {
533 M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0,
534 M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0,
535 M::coordinate_type(this->_31), M::coordinate_type(this->_32), 1,
539 inline SDKMatrixD3X2::operator
SDKMatrixD3X3() const noexcept {
542 M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0,
543 M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0,
544 M::coordinate_type(this->_31), M::coordinate_type(this->_32), 1,
548 inline SDKMatrixD3X2::operator
SDKMatrixF4X4() const noexcept {
551 M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0, 0,
552 M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0, 0,
553 M::coordinate_type(this->_31), M::coordinate_type(this->_32), 0, 0,
558 inline SDKMatrixD3X2::operator
SDKMatrixD4X4() const noexcept {
561 M::coordinate_type(this->_11), M::coordinate_type(this->_12), 0, 0,
562 M::coordinate_type(this->_21), M::coordinate_type(this->_22), 0, 0,
563 M::coordinate_type(this->_31), M::coordinate_type(this->_32), 0, 0,
570 #if 1 || SDKMatrixD3X3
572 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0;
573 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0;
574 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1;
578 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0;
579 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0;
580 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1;
584 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
585 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
586 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
590 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
591 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
592 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
596 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13);
597 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23);
598 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33);
601 inline SDKMatrixD3X3::operator
SDKMatrixF3X2() const noexcept {
604 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
605 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
606 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
610 inline SDKMatrixD3X3::operator
SDKMatrixD3X2() const noexcept {
613 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
614 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
615 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
619 inline SDKMatrixD3X3::operator
SDKMatrixF3X3() const noexcept {
622 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
623 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
624 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
637 inline SDKMatrixD3X3::operator
SDKMatrixF4X4() const noexcept {
640 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), 0,
641 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), 0,
642 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), 0,
647 inline SDKMatrixD3X3::operator
SDKMatrixD4X4() const noexcept {
650 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), 0,
651 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), 0,
652 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), 0,
659 #if 1 || SDKMatrixD4X4
661 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0, this->_14 = 0;
662 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0, this->_24 = 0;
663 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1, this->_34 = 0;
664 this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
668 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = 0, this->_14 = 0;
669 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = 0, this->_24 = 0;
670 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = 1, this->_34 = 0;
671 this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
675 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13), this->_14 = 0;
676 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23), this->_24 = 0;
677 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33), this->_34 = 0;
678 this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
682 this->_11 = coordinate_type(m._11), this->_12 = coordinate_type(m._12), this->_13 = coordinate_type(m._13), this->_14 = 0;
683 this->_21 = coordinate_type(m._21), this->_22 = coordinate_type(m._22), this->_23 = coordinate_type(m._23), this->_24 = 0;
684 this->_31 = coordinate_type(m._31), this->_32 = coordinate_type(m._32), this->_33 = coordinate_type(m._33), this->_34 = 0;
685 this->_41 = 0, this->_42 = 0, this->_43 = 0, this->_44 = 1;
689 for (
int row = 0; row < 4; ++row) {
690 this->_m[row][0] = coordinate_type(m._m[row][0]);
691 this->_m[row][1] = coordinate_type(m._m[row][1]);
692 this->_m[row][2] = coordinate_type(m._m[row][2]);
693 this->_m[row][3] = coordinate_type(m._m[row][3]);
697 inline SDKMatrixD4X4::operator
SDKMatrixF3X2() const noexcept {
700 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
701 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
702 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
706 inline SDKMatrixD4X4::operator
SDKMatrixD3X2() const noexcept {
709 M::coordinate_type(this->_11), M::coordinate_type(this->_12),
710 M::coordinate_type(this->_21), M::coordinate_type(this->_22),
711 M::coordinate_type(this->_31), M::coordinate_type(this->_32),
715 inline SDKMatrixD4X4::operator
SDKMatrixF3X3() const noexcept {
718 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
719 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
720 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
724 inline SDKMatrixD4X4::operator
SDKMatrixD3X3() const noexcept {
727 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13),
728 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23),
729 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33),
733 inline SDKMatrixD4X4::operator
SDKMatrixF4X4() const noexcept {
736 M::coordinate_type(this->_11), M::coordinate_type(this->_12), M::coordinate_type(this->_13), M::coordinate_type(this->_14),
737 M::coordinate_type(this->_21), M::coordinate_type(this->_22), M::coordinate_type(this->_23), M::coordinate_type(this->_24),
738 M::coordinate_type(this->_31), M::coordinate_type(this->_32), M::coordinate_type(this->_33), M::coordinate_type(this->_34),
739 M::coordinate_type(this->_41), M::coordinate_type(this->_42), M::coordinate_type(this->_43), M::coordinate_type(this->_44),
758 && lhs._11 == rhs._11 && lhs._12 == rhs._12
759 && lhs._21 == rhs._21 && lhs._22 == rhs._22
760 && lhs._31 == rhs._31 && lhs._32 == rhs._32;
764 return !(lhs == rhs);
769 && lhs._11 == rhs._11 && lhs._12 == rhs._12 && lhs._13 == rhs._13
770 && lhs._21 == rhs._21 && lhs._22 == rhs._22 && lhs._23 == rhs._23
771 && lhs._31 == rhs._31 && lhs._32 == rhs._32 && lhs._33 == rhs._33;
775 return !(lhs == rhs);
779 for (
int j = 0; j < 4; ++j)
781 for (
int i = 0; i < 4; ++i)
783 if (lhs._m[j][i] != rhs._m[j][i])
791 return !(lhs == rhs);
796 && lhs._11 == rhs._11 && lhs._12 == rhs._12
797 && lhs._21 == rhs._21 && lhs._22 == rhs._22
798 && lhs._31 == rhs._31 && lhs._32 == rhs._32;
802 return !(lhs == rhs);
807 && lhs._11 == rhs._11 && lhs._12 == rhs._12 && lhs._13 == rhs._13
808 && lhs._21 == rhs._21 && lhs._22 == rhs._22 && lhs._23 == rhs._23
809 && lhs._31 == rhs._31 && lhs._32 == rhs._32 && lhs._33 == rhs._33;
813 return !(lhs == rhs);
817 for (
int j = 0; j < 4; ++j)
819 for (
int i = 0; i < 4; ++i)
821 if (lhs._m[j][i] != rhs._m[j][i])
829 return !(lhs == rhs);
832 template <
class _Matrix3X3>
833 _Matrix3X3 Matrix3X3MultiplyHelper(
const _Matrix3X3& lhs,
const _Matrix3X3& rhs)
836 typedef typename _Matrix3X3::coordinate_type coordinate_type;
837 res._11 = coordinate_type(
double(lhs._11) * rhs._11 +
double(lhs._12) * rhs._21 +
double(lhs._13) * rhs._31);
838 res._12 = coordinate_type(
double(lhs._11) * rhs._12 +
double(lhs._12) * rhs._22 +
double(lhs._13) * rhs._32);
839 res._13 = coordinate_type(
double(lhs._11) * rhs._13 +
double(lhs._12) * rhs._23 +
double(lhs._13) * rhs._33);
841 res._21 = coordinate_type(
double(lhs._21) * rhs._11 +
double(lhs._22) * rhs._21 +
double(lhs._23) * rhs._31);
842 res._22 = coordinate_type(
double(lhs._21) * rhs._12 +
double(lhs._22) * rhs._22 +
double(lhs._23) * rhs._32);
843 res._23 = coordinate_type(
double(lhs._21) * rhs._13 +
double(lhs._22) * rhs._23 +
double(lhs._23) * rhs._33);
845 res._31 = coordinate_type(
double(lhs._31) * rhs._11 +
double(lhs._32) * rhs._21 +
double(lhs._33) * rhs._31);
846 res._32 = coordinate_type(
double(lhs._31) * rhs._12 +
double(lhs._32) * rhs._22 +
double(lhs._33) * rhs._32);
847 res._33 = coordinate_type(
double(lhs._31) * rhs._13 +
double(lhs._32) * rhs._23 +
double(lhs._33) * rhs._33);
853 return Matrix3X3MultiplyHelper(lhs, rhs);
858 return Matrix3X3MultiplyHelper(lhs, rhs);
873 template <
class _Matrix4X4>
874 _Matrix4X4 Matrix4X4MultiplyHelper(
const _Matrix4X4& lhs,
const _Matrix4X4& rhs)
877 typedef typename _Matrix4X4::coordinate_type coordinate_type;
878 res._11 = coordinate_type(
879 double(lhs._11) * rhs._11 +
double(lhs._12) * rhs._21 +
double(lhs._13) * rhs._31 +
double(lhs._14) * rhs._41);
880 res._21 = coordinate_type(
881 double(lhs._21) * rhs._11 +
double(lhs._22) * rhs._21 +
double(lhs._23) * rhs._31 +
double(lhs._24) * rhs._41);
882 res._31 = coordinate_type(
883 double(lhs._31) * rhs._11 +
double(lhs._32) * rhs._21 +
double(lhs._33) * rhs._31 +
double(lhs._34) * rhs._41);
884 res._41 = coordinate_type(
885 double(lhs._41) * rhs._11 +
double(lhs._42) * rhs._21 +
double(lhs._43) * rhs._31 +
double(lhs._44) * rhs._41);
886 res._12 = coordinate_type(
887 double(lhs._11) * rhs._12 +
double(lhs._12) * rhs._22 +
double(lhs._13) * rhs._32 +
double(lhs._14) * rhs._42);
888 res._22 = coordinate_type(
889 double(lhs._21) * rhs._12 +
double(lhs._22) * rhs._22 +
double(lhs._23) * rhs._32 +
double(lhs._24) * rhs._42);
890 res._32 = coordinate_type(
891 double(lhs._31) * rhs._12 +
double(lhs._32) * rhs._22 +
double(lhs._33) * rhs._32 +
double(lhs._34) * rhs._42);
892 res._42 = coordinate_type(
893 double(lhs._41) * rhs._12 +
double(lhs._42) * rhs._22 +
double(lhs._43) * rhs._32 +
double(lhs._44) * rhs._42);
894 res._13 = coordinate_type(
895 double(lhs._11) * rhs._13 +
double(lhs._12) * rhs._23 +
double(lhs._13) * rhs._33 +
double(lhs._14) * rhs._43);
896 res._23 = coordinate_type(
897 double(lhs._21) * rhs._13 +
double(lhs._22) * rhs._23 +
double(lhs._23) * rhs._33 +
double(lhs._24) * rhs._43);
898 res._33 = coordinate_type(
899 double(lhs._31) * rhs._13 +
double(lhs._32) * rhs._23 +
double(lhs._33) * rhs._33 +
double(lhs._34) * rhs._43);
900 res._43 = coordinate_type(
901 double(lhs._41) * rhs._13 +
double(lhs._42) * rhs._23 +
double(lhs._43) * rhs._33 +
double(lhs._44) * rhs._43);
902 res._14 = coordinate_type(
903 double(lhs._11) * rhs._14 +
double(lhs._12) * rhs._24 +
double(lhs._13) * rhs._34 +
double(lhs._14) * rhs._44);
904 res._24 = coordinate_type(
905 double(lhs._21) * rhs._14 +
double(lhs._22) * rhs._24 +
double(lhs._23) * rhs._34 +
double(lhs._24) * rhs._44);
906 res._34 = coordinate_type(
907 double(lhs._31) * rhs._14 +
double(lhs._32) * rhs._24 +
double(lhs._33) * rhs._34 +
double(lhs._34) * rhs._44);
908 res._44 = coordinate_type(
909 double(lhs._41) * rhs._14 +
double(lhs._42) * rhs._24 +
double(lhs._43) * rhs._34 +
double(lhs._44) * rhs._44);
915 return Matrix4X4MultiplyHelper(lhs, rhs);
920 return Matrix4X4MultiplyHelper(lhs, rhs);
936 inline double min4dbl(
double d1,
double d2,
double d3,
double d4) {
937 double min1 = (d1 < d2) ? d1 : d2;
938 double min2 = (d3 < d4) ? d3 : d4;
939 return (min1 < min2) ? min1 : min2;
942 inline double max4dbl(
double d1,
double d2,
double d3,
double d4) {
943 double max1 = (d1 > d2) ? d1 : d2;
944 double max2 = (d3 > d4) ? d3 : d4;
945 return (max1 > max2) ? max1 : max2;
950 #if defined(__clang__) || defined(__GNUC__)
951 #pragma GCC diagnostic pop
954 #endif // SDK_MATRIX_BASE_TYPES_H_