UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Matrix.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#if !COMPILE_WITHOUT_UNREAL_SUPPORT
5#include "Math/Matrix.h"
6#include "Chaos/Vector.h"
7#else
8#include <array>
9
11{
12public:
13 std::array<std::array<Chaos::FReal, 4>, 4> M;
14};
15#endif
16
17namespace Chaos
18{
19 template<class T, int m, int n>
20 class PMatrix
21 {
22 private:
23 PMatrix() {}
24 ~PMatrix() {}
25 };
26
27 template<>
28 class PMatrix<FRealDouble, 3, 2>
29 {
30 public:
32
34 {
35 M[0] = C1.X;
36 M[1] = C1.Y;
37 M[2] = C1.Z;
38 M[3] = C2.X;
39 M[4] = C2.Y;
40 M[5] = C2.Z;
41 }
42
44 {
45 M[0] = x00;
46 M[1] = x10;
47 M[2] = x20;
48 M[3] = x01;
49 M[4] = x11;
50 M[5] = x21;
51 }
52
54 {
56 M[0] * Other[0] + M[3] * Other[1],
57 M[1] * Other[0] + M[4] * Other[1],
58 M[2] * Other[0] + M[5] * Other[1]);
59 }
60 };
61
62 template<>
63 class PMatrix<FRealSingle, 3, 2>
64 {
65 public:
67
69 {
70 M[0] = C1.X;
71 M[1] = C1.Y;
72 M[2] = C1.Z;
73 M[3] = C2.X;
74 M[4] = C2.Y;
75 M[5] = C2.Z;
76 }
77
79 {
80 M[0] = x00;
81 M[1] = x10;
82 M[2] = x20;
83 M[3] = x01;
84 M[4] = x11;
85 M[5] = x21;
86 }
87
89 {
90 M[0] = x00;
91 M[1] = x00;
92 M[2] = x00;
93 M[3] = x00;
94 M[4] = x00;
95 M[5] = x00;
96 }
97
99 {
101 M[0] * Other[0] + M[3] * Other[1],
102 M[1] * Other[0] + M[4] * Other[1],
103 M[2] * Other[0] + M[5] * Other[1]);
104 }
105
107 {
109 M[0] - Other.M[0],
110 M[1] - Other.M[1],
111 M[2] - Other.M[2],
112 M[3] - Other.M[3],
113 M[4] - Other.M[4],
114 M[5] - Other.M[5]);
115 }
116
118 {
120 M[0] + Other.M[0],
121 M[1] + Other.M[1],
122 M[2] + Other.M[2],
123 M[3] + Other.M[3],
124 M[4] + Other.M[4],
125 M[5] + Other.M[5]);
126 }
127
129 {
131 OtherF * OtherM.M[0],
132 OtherF * OtherM.M[1],
133 OtherF * OtherM.M[2],
134 OtherF * OtherM.M[3],
135 OtherF * OtherM.M[4],
136 OtherF * OtherM.M[5]);
137 }
138
139
140 };
141
142 template<>
143 class PMatrix<FReal, 2, 2>
144 {
145 public:
146 FReal M[4];
147
148 PMatrix(const FReal x00, const FReal x10, const FReal x01, const FReal x11)
149 {
150 M[0] = x00;
151 M[1] = x10;
152 M[2] = x01;
153 M[3] = x11;
154 }
155
156 PMatrix(const FReal x00, const FReal x10, const FReal x11)
157 {
158 M[0] = x00;
159 M[1] = x10;
160 M[2] = x10;
161 M[3] = x11;
162 }
163
165 {
167 M[0] - Scalar,
168 M[1],
169 M[2],
170 M[3] - Scalar);
171 }
172
174 {
175 return TVector<FReal, 2>(
176 M[0] * Other.X + M[2] * Other.Y,
177 M[1] * Other.X + M[3] * Other.Y);
178 }
179
181 {
182 const FReal OneOverDeterminant = static_cast<FReal>(1.0) / (M[0] * M[3] - M[1] * M[2]);
184 OneOverDeterminant * M[3],
185 -OneOverDeterminant * M[1],
186 -OneOverDeterminant * M[2],
187 OneOverDeterminant * M[0]);
188 }
189
191 {
192 return PMatrix<FReal, 2, 2>(M[0], M[2], M[1], M[3]);
193 }
194 };
195
196 template<>
197 class PMatrix<FRealSingle, 2, 2>
198 {
199 public:
201
203 {
204 M[0] = x00;
205 M[1] = x10;
206 M[2] = x01;
207 M[3] = x11;
208 }
209
211 {
212 M[0] = x00;
213 M[1] = x10;
214 M[2] = x10;
215 M[3] = x11;
216 }
217
219 {
221 M[0] - Scalar,
222 M[1],
223 M[2],
224 M[3] - Scalar);
225 }
226
228 {
230 M[0] * Other.X + M[2] * Other.Y,
231 M[1] * Other.X + M[3] * Other.Y);
232 }
233
235 {
236 const FRealSingle OneOverDeterminant = static_cast<FRealSingle>(1.0) / (M[0] * M[3] - M[1] * M[2]);
238 OneOverDeterminant * M[3],
239 -OneOverDeterminant * M[1],
240 -OneOverDeterminant * M[2],
241 OneOverDeterminant * M[0]);
242 }
243
245 {
246 return PMatrix<FRealSingle, 2, 2>(M[0], M[2], M[1], M[3]);
247 }
248
250 {
251 return M[0] * M[3] - M[1] * M[2];
252 }
253
255 {
256 return M[ColIndex * 2 + RowIndex];
257 }
258
259 //This is not column major so no need to invert matrix order when multiply them
261 {
263 Other.M[0] * M[0] + Other.M[1] * M[2],
264 M[1] * Other.M[0] + M[3] * Other.M[1],
265 M[0] * Other.M[2] + M[2] * Other.M[3],
266 M[1] * Other.M[2] + M[3] * Other.M[3]);
267 }
268
270 {
272 First.M[0] * Other.M[0] + First.M[3] * Other.M[1],
273 First.M[1] * Other.M[0] + First.M[4] * Other.M[1],
274 First.M[2] * Other.M[0] + First.M[5] * Other.M[1],
275 First.M[0] * Other.M[2] + First.M[3] * Other.M[3],
276 First.M[1] * Other.M[2] + First.M[4] * Other.M[3],
277 First.M[2] * Other.M[2] + First.M[5] * Other.M[3]);
278 }
279 };
280
281 template<>
282 class PMatrix<FRealSingle, 4, 4> : public UE::Math::TMatrix<FRealSingle>
283 {
284 public:
286 : UE::Math::TMatrix<FRealSingle>() {}
288 : UE::Math::TMatrix<FRealSingle>()
289 {
290 M[0][0] = x00;
291 M[1][0] = x10;
292 M[2][0] = x20;
293 M[3][0] = x30;
294 M[0][1] = x01;
295 M[1][1] = x11;
296 M[2][1] = x21;
297 M[3][1] = x31;
298 M[0][2] = x02;
299 M[1][2] = x12;
300 M[2][2] = x22;
301 M[3][2] = x32;
302 M[0][3] = x03;
303 M[1][3] = x13;
304 M[2][3] = x23;
305 M[3][3] = x33;
306 }
308 : UE::Math::TMatrix<FRealSingle>(Matrix)
309 {
310 }
311#if COMPILE_WITHOUT_UNREAL_SUPPORT
313 {
315 M[0][0] * Other[0] + M[0][1] * Other[1] + M[0][2] * Other[2] + M[0][3] * Other[3],
316 M[1][0] * Other[0] + M[1][1] * Other[1] + M[1][2] * Other[2] + M[1][3] * Other[3],
317 M[2][0] * Other[0] + M[2][1] * Other[1] + M[2][2] * Other[2] + M[2][3] * Other[3],
318 M[3][0] * Other[0] + M[3][1] * Other[1] + M[3][2] * Other[2] + M[3][3] * Other[3]);
319 }
320#endif
321
323 {
324 return static_cast<const UE::Math::TMatrix<FRealSingle>*>(this)->operator*(static_cast<const UE::Math::TMatrix<FRealSingle>&>(Other));
325 }
326 };
327
328 template<>
329 class PMatrix<FRealDouble, 4, 4> : public UE::Math::TMatrix<FRealDouble>
330 {
331 public:
333 : UE::Math::TMatrix<FRealDouble>() {}
335 : UE::Math::TMatrix<FRealDouble>()
336 {
337 M[0][0] = x00;
338 M[1][0] = x10;
339 M[2][0] = x20;
340 M[3][0] = x30;
341 M[0][1] = x01;
342 M[1][1] = x11;
343 M[2][1] = x21;
344 M[3][1] = x31;
345 M[0][2] = x02;
346 M[1][2] = x12;
347 M[2][2] = x22;
348 M[3][2] = x32;
349 M[0][3] = x03;
350 M[1][3] = x13;
351 M[2][3] = x23;
352 M[3][3] = x33;
353 }
355 : UE::Math::TMatrix<FRealDouble>(Matrix)
356 {
357 }
358#if COMPILE_WITHOUT_UNREAL_SUPPORT
360 {
362 M[0][0] * Other[0] + M[0][1] * Other[1] + M[0][2] * Other[2] + M[0][3] * Other[3],
363 M[1][0] * Other[0] + M[1][1] * Other[1] + M[1][2] * Other[2] + M[1][3] * Other[3],
364 M[2][0] * Other[0] + M[2][1] * Other[1] + M[2][2] * Other[2] + M[2][3] * Other[3],
365 M[3][0] * Other[0] + M[3][1] * Other[1] + M[3][2] * Other[2] + M[3][3] * Other[3]);
366 }
367#endif
368
370 {
371 return static_cast<const UE::Math::TMatrix<FRealDouble>*>(this)->operator*(static_cast<const UE::Math::TMatrix<FRealDouble>&>(Other));
372 }
373 };
374
375 // TODO(mlentine): Do not use 4x4 matrix for 3x3 implementation
376 template<>
377 class PMatrix<FRealDouble, 3, 3> : public UE::Math::TMatrix<FRealDouble>
378 {
379 public:
381 : UE::Math::TMatrix<FRealDouble>() {}
385 : UE::Math::TMatrix<FRealDouble>((UE::Math::TMatrix<FRealDouble>)Other) {}
387 : UE::Math::TMatrix<FRealDouble>((UE::Math::TMatrix<FRealDouble>)Other) {}
389 : UE::Math::TMatrix<FRealDouble>()
390 {
391 M[0][0] = x00;
392 M[1][0] = 0;
393 M[2][0] = 0;
394 M[0][1] = 0;
395 M[1][1] = x11;
396 M[2][1] = 0;
397 M[0][2] = 0;
398 M[1][2] = 0;
399 M[2][2] = x22;
400 // Fill in the remainder with reasonable values.
401 M[3][0] = 0;
402 M[3][1] = 0;
403 M[3][2] = 0;
404 M[3][3] = 1;
405 M[0][3] = 0;
406 M[1][3] = 0;
407 M[2][3] = 0;
408 }
410 : UE::Math::TMatrix<FReal>()
411 {
412 M[0][0] = Vector[0];
413 M[1][0] = 0;
414 M[2][0] = 0;
415 M[0][1] = 0;
416 M[1][1] = Vector[1];
417 M[2][1] = 0;
418 M[0][2] = 0;
419 M[1][2] = 0;
420 M[2][2] = Vector[2];
421 M[3][0] = 0;
422 M[3][1] = 0;
423 M[3][2] = 0;
424 M[3][3] = 1;
425 M[0][3] = 0;
426 M[1][3] = 0;
427 M[2][3] = 0;
428 }
430 : UE::Math::TMatrix<FRealDouble>()
431 {
432 M[0][0] = x00;
433 M[1][0] = x10;
434 M[2][0] = x20;
435 M[0][1] = x10;
436 M[1][1] = x11;
437 M[2][1] = x21;
438 M[0][2] = x20;
439 M[1][2] = x21;
440 M[2][2] = x22;
441 // Fill in the remainder with reasonable values.
442 M[3][0] = 0;
443 M[3][1] = 0;
444 M[3][2] = 0;
445 M[3][3] = 1;
446 M[0][3] = 0;
447 M[1][3] = 0;
448 M[2][3] = 0;
449 }
451 : UE::Math::TMatrix<FRealDouble>()
452 {
453 M[0][0] = x00;
454 M[1][0] = x10;
455 M[2][0] = x20;
456 M[0][1] = x01;
457 M[1][1] = x11;
458 M[2][1] = x21;
459 M[0][2] = x02;
460 M[1][2] = x12;
461 M[2][2] = x22;
462 // Fill in the remainder with reasonable values.
463 M[3][0] = 0;
464 M[3][1] = 0;
465 M[3][2] = 0;
466 M[3][3] = 1;
467 M[0][3] = 0;
468 M[1][3] = 0;
469 M[2][3] = 0;
470 }
472 : UE::Math::TMatrix<FRealDouble>()
473 {
474 M[0][0] = x;
475 M[1][0] = x;
476 M[2][0] = x;
477 M[0][1] = x;
478 M[1][1] = x;
479 M[2][1] = x;
480 M[0][2] = x;
481 M[1][2] = x;
482 M[2][2] = x;
483 // Fill in the remainder with reasonable values.
484 M[3][0] = 0;
485 M[3][1] = 0;
486 M[3][2] = 0;
487 M[3][3] = 1;
488 M[0][3] = 0;
489 M[1][3] = 0;
490 M[2][3] = 0;
491 }
493 {
494 M[0][0] = C1.X;
495 M[1][0] = C1.Y;
496 M[2][0] = C1.Z;
497 M[0][1] = C2.X;
498 M[1][1] = C2.Y;
499 M[2][1] = C2.Z;
500 M[0][2] = C3.X;
501 M[1][2] = C3.Y;
502 M[2][2] = C3.Z;
503 // Fill in the remainder with reasonable values.
504 M[3][0] = 0;
505 M[3][1] = 0;
506 M[3][2] = 0;
507 M[3][3] = 1;
508 M[0][3] = 0;
509 M[1][3] = 0;
510 M[2][3] = 0;
511 }
512
514 {
515 return PMatrix<FRealDouble, 3, 3>(M[0][0], M[0][1], M[0][2], M[1][0], M[1][1], M[1][2], M[2][0], M[2][1], M[2][2]);
516 }
518 {
519 return M[0][0] * (M[1][1] * M[2][2] - M[1][2] * M[2][1]) - M[0][1] * (M[1][0] * M[2][2] - M[1][2] * M[2][0]) + M[0][2] * (M[1][0] * M[2][1] - M[1][1] * M[2][0]);
520 }
522 {
523 M[0][0] += Other.M[0][0];
524 M[0][1] += Other.M[0][1];
525 M[0][2] += Other.M[0][2];
526 M[1][0] += Other.M[1][0];
527 M[1][1] += Other.M[1][1];
528 M[1][2] += Other.M[1][2];
529 M[2][0] += Other.M[2][0];
530 M[2][1] += Other.M[2][1];
531 M[2][2] += Other.M[2][2];
532 return *this;
533 }
534
535 // TDOD(mlentine): This should really be a vector multiply and sum for each entry using sse
537 {
539 M[0][0] * Other[0] + M[0][1] * Other[1] + M[0][2] * Other[2],
540 M[1][0] * Other[0] + M[1][1] * Other[1] + M[1][2] * Other[2],
541 M[2][0] * Other[0] + M[2][1] * Other[1] + M[2][2] * Other[2]);
542 }
544 {
546 M[0][0] + Other.M[0][0],
547 M[1][0] + Other.M[1][0],
548 M[2][0] + Other.M[2][0],
549 M[0][1] + Other.M[0][1],
550 M[1][1] + Other.M[1][1],
551 M[2][1] + Other.M[2][1],
552 M[0][2] + Other.M[0][2],
553 M[1][2] + Other.M[1][2],
554 M[2][2] + Other.M[2][2]);
555 }
561 {
563 M[0][0] - Other.M[0][0],
564 M[1][0] - Other.M[1][0],
565 M[2][0] - Other.M[2][0],
566 M[0][1] - Other.M[0][1],
567 M[1][1] - Other.M[1][1],
568 M[2][1] - Other.M[2][1],
569 M[0][2] - Other.M[0][2],
570 M[1][2] - Other.M[1][2],
571 M[2][2] - Other.M[2][2]);
572 }
574 {
576 -Other.M[0][0],
577 -Other.M[1][0],
578 -Other.M[2][0],
579 -Other.M[0][1],
580 -Other.M[1][1],
581 -Other.M[2][1],
582 -Other.M[0][2],
583 -Other.M[1][2],
584 -Other.M[2][2]);
585 }
587 {
588 return static_cast<const UE::Math::TMatrix<FRealDouble>*>(this)->operator*(static_cast<const UE::Math::TMatrix<FRealDouble>&>(Other));
589 }
590 // Needs to be overridden because base version multiplies M[3][3]
592 {
594 M[0][0] * Other,
595 M[1][0] * Other,
596 M[2][0] * Other,
597 M[0][1] * Other,
598 M[1][1] * Other,
599 M[2][1] * Other,
600 M[0][2] * Other,
601 M[1][2] * Other,
602 M[2][2] * Other);
603 }
604 // Needs to be overridden because base version multiplies M[3][3]
606 {
607 M[0][0] *= Other;
608 M[0][1] *= Other;
609 M[0][2] *= Other;
610 M[1][0] *= Other;
611 M[1][1] *= Other;
612 M[1][2] *= Other;
613 M[2][0] *= Other;
614 M[2][1] *= Other;
615 M[2][2] *= Other;
616 return *this;
617 }
623 {
625 M[0][0] * Other.M[0] + M[0][1] * Other.M[1] + M[0][2] * Other.M[2],
626 M[1][0] * Other.M[0] + M[1][1] * Other.M[1] + M[1][2] * Other.M[2],
627 M[2][0] * Other.M[0] + M[2][1] * Other.M[1] + M[2][2] * Other.M[2],
628 M[0][0] * Other.M[3] + M[0][1] * Other.M[4] + M[0][2] * Other.M[5],
629 M[1][0] * Other.M[3] + M[1][1] * Other.M[4] + M[1][2] * Other.M[5],
630 M[2][0] * Other.M[3] + M[2][1] * Other.M[4] + M[2][2] * Other.M[5]);
631 }
633 {
635 M[0][0] - Scalar,
636 M[1][0],
637 M[2][0],
638 M[0][1],
639 M[1][1] - Scalar,
640 M[2][1],
641 M[0][2],
642 M[1][2],
643 M[2][2] - Scalar);
644 }
646 {
648 M[1][1] * M[2][2] - M[2][1] * M[2][1],
649 M[2][1] * M[2][0] - M[1][0] * M[2][2],
650 M[1][0] * M[2][1] - M[1][1] * M[2][0],
651 M[0][0] * M[2][2] - M[2][0] * M[2][0],
652 M[1][0] * M[2][0] - M[0][0] * M[2][1],
653 M[0][0] * M[1][1] - M[1][0] * M[1][0]);
654 }
656 {
657 FRealDouble m10 = M[1][0] * M[1][0];
658 FRealDouble m20 = M[2][0] * M[2][0];
659 FRealDouble m21 = M[2][1] * M[2][1];
660 FRealDouble c0 = M[0][0] * M[0][0] + m10 + m20;
661 FRealDouble c1 = m10 + M[1][1] * M[1][1] + m21;
662 FRealDouble c2 = m20 + m21 + M[2][2] * M[2][2];
663 if (c0 > c1 && c0 > c2)
664 {
665 return TVector<FRealDouble, 3>(M[0][0], M[1][0], M[2][0]) / FMath::Sqrt(c0);
666 }
667 if (c1 > c2)
668 {
669 return TVector<FRealDouble, 3>(M[1][0], M[1][1], M[2][1]) / FMath::Sqrt(c1);
670 }
671 if (c2 > 0)
672 {
673 return TVector<FRealDouble, 3>(M[2][0], M[2][1], M[2][2]) / FMath::Sqrt(c2);
674 }
675 return TVector<FRealDouble, 3>(1, 0, 0);
676 }
677
683 {
684 return TVector<FRealDouble, 3>(M[AxisIndex][0], M[AxisIndex][1], M[AxisIndex][2]);
685 }
686
692 {
693 M[AxisIndex][0] = Axis.X;
694 M[AxisIndex][1] = Axis.Y;
695 M[AxisIndex][2] = Axis.Z;
696 M[AxisIndex][3] = 0;
697 }
698
705 {
706 return TVector<FRealDouble, 3>(M[0][RowIndex], M[1][RowIndex], M[2][RowIndex]);
707 }
708
715 {
716 M[0][RowIndex] = V.X;
717 M[1][RowIndex] = V.Y;
718 M[2][RowIndex] = V.Z;
719 M[3][RowIndex] = 0;
720 }
721
731
738 {
739 SetAxis(ColumnIndex, V);
740 }
741
746 {
747 return TVector<FRealDouble, 3>(M[0][0], M[1][1], M[2][2]);
748 }
749
751 {
752 return M[ColIndex][RowIndex];
753 }
754
756 {
757 M[ColIndex][RowIndex] = V;
758 }
759
767
768#if COMPILE_WITHOUT_UNREAL_SUPPORT
769 // TODO(mlentine): Document which one is row and which one is column
771 {
773 M[0][0] * Other.M[0][0] + M[0][1] * Other.M[1][0] + M[0][2] * Other.M[2][0],
774 M[1][0] * Other.M[0][0] + M[1][1] * Other.M[1][0] + M[1][2] * Other.M[2][0],
775 M[2][0] * Other.M[0][0] + M[2][1] * Other.M[1][0] + M[2][2] * Other.M[2][0],
776 M[0][0] * Other.M[0][1] + M[0][1] * Other.M[1][1] + M[0][2] * Other.M[2][1],
777 M[1][0] * Other.M[0][1] + M[1][1] * Other.M[1][1] + M[1][2] * Other.M[2][1],
778 M[2][0] * Other.M[0][1] + M[2][1] * Other.M[1][1] + M[2][2] * Other.M[2][1],
779 M[0][0] * Other.M[0][2] + M[0][1] * Other.M[1][2] + M[0][2] * Other.M[2][2],
780 M[1][0] * Other.M[0][2] + M[1][1] * Other.M[1][2] + M[1][2] * Other.M[2][2],
781 M[2][0] * Other.M[0][2] + M[2][1] * Other.M[1][2] + M[2][2] * Other.M[2][2]);
782 }
783#endif
785 {
786 return true
787 && (FMath::Abs(Other.M[0][0] - M[0][0]) <= Tolerance)
788 && (FMath::Abs(Other.M[0][1] - M[0][1]) <= Tolerance)
789 && (FMath::Abs(Other.M[0][2] - M[0][2]) <= Tolerance)
790 && (FMath::Abs(Other.M[1][0] - M[1][0]) <= Tolerance)
791 && (FMath::Abs(Other.M[1][1] - M[1][1]) <= Tolerance)
792 && (FMath::Abs(Other.M[1][2] - M[1][2]) <= Tolerance)
793 && (FMath::Abs(Other.M[2][0] - M[2][0]) <= Tolerance)
794 && (FMath::Abs(Other.M[2][1] - M[2][1]) <= Tolerance)
795 && (FMath::Abs(Other.M[2][2] - M[2][2]) <= Tolerance);
796 }
797
798 // M[i][j] = x[i] * y[j]
800 {
802 X[0] * Y[0],
803 X[1] * Y[0],
804 X[2] * Y[0],
805 X[0] * Y[1],
806 X[1] * Y[1],
807 X[2] * Y[1],
808 X[0] * Y[2],
809 X[1] * Y[2],
810 X[2] * Y[2]);
811 }
812
815 };
816
817 template<>
818 class PMatrix<FRealSingle, 3, 3> : public UE::Math::TMatrix<FRealSingle>
819 {
820 public:
822 : UE::Math::TMatrix<FRealSingle>() {}
826 : UE::Math::TMatrix<FRealSingle>((UE::Math::TMatrix<FRealSingle>)Other) {}
828 : UE::Math::TMatrix<FRealSingle>((UE::Math::TMatrix<FRealSingle>)Other) {}
830 : UE::Math::TMatrix<FRealSingle>()
831 {
832 M[0][0] = x00;
833 M[1][0] = 0;
834 M[2][0] = 0;
835 M[0][1] = 0;
836 M[1][1] = x11;
837 M[2][1] = 0;
838 M[0][2] = 0;
839 M[1][2] = 0;
840 M[2][2] = x22;
841 // Fill in the remainder with reasonable values.
842 M[3][0] = 0;
843 M[3][1] = 0;
844 M[3][2] = 0;
845 M[3][3] = 1;
846 M[0][3] = 0;
847 M[1][3] = 0;
848 M[2][3] = 0;
849 }
851 : UE::Math::TMatrix<FReal>()
852 {
853 M[0][0] = Vector[0];
854 M[1][0] = 0;
855 M[2][0] = 0;
856 M[0][1] = 0;
857 M[1][1] = Vector[1];
858 M[2][1] = 0;
859 M[0][2] = 0;
860 M[1][2] = 0;
861 M[2][2] = Vector[2];
862 M[3][0] = 0;
863 M[3][1] = 0;
864 M[3][2] = 0;
865 M[3][3] = 1;
866 M[0][3] = 0;
867 M[1][3] = 0;
868 M[2][3] = 0;
869 }
871 : UE::Math::TMatrix<FRealSingle>()
872 {
873 M[0][0] = x00;
874 M[1][0] = x10;
875 M[2][0] = x20;
876 M[0][1] = x10;
877 M[1][1] = x11;
878 M[2][1] = x21;
879 M[0][2] = x20;
880 M[1][2] = x21;
881 M[2][2] = x22;
882 // Fill in the remainder with reasonable values.
883 M[3][0] = 0;
884 M[3][1] = 0;
885 M[3][2] = 0;
886 M[3][3] = 1;
887 M[0][3] = 0;
888 M[1][3] = 0;
889 M[2][3] = 0;
890 }
892 : UE::Math::TMatrix<FRealSingle>()
893 {
894 M[0][0] = x00;
895 M[1][0] = x10;
896 M[2][0] = x20;
897 M[0][1] = x01;
898 M[1][1] = x11;
899 M[2][1] = x21;
900 M[0][2] = x02;
901 M[1][2] = x12;
902 M[2][2] = x22;
903 // Fill in the remainder with reasonable values.
904 M[3][0] = 0;
905 M[3][1] = 0;
906 M[3][2] = 0;
907 M[3][3] = 1;
908 M[0][3] = 0;
909 M[1][3] = 0;
910 M[2][3] = 0;
911 }
913 : UE::Math::TMatrix<FRealSingle>()
914 {
915 M[0][0] = x;
916 M[1][0] = x;
917 M[2][0] = x;
918 M[0][1] = x;
919 M[1][1] = x;
920 M[2][1] = x;
921 M[0][2] = x;
922 M[1][2] = x;
923 M[2][2] = x;
924 // Fill in the remainder with reasonable values.
925 M[3][0] = 0;
926 M[3][1] = 0;
927 M[3][2] = 0;
928 M[3][3] = 1;
929 M[0][3] = 0;
930 M[1][3] = 0;
931 M[2][3] = 0;
932 }
934 {
935 M[0][0] = C1.X;
936 M[1][0] = C1.Y;
937 M[2][0] = C1.Z;
938 M[0][1] = C2.X;
939 M[1][1] = C2.Y;
940 M[2][1] = C2.Z;
941 M[0][2] = C3.X;
942 M[1][2] = C3.Y;
943 M[2][2] = C3.Z;
944 // Fill in the remainder with reasonable values.
945 M[3][0] = 0;
946 M[3][1] = 0;
947 M[3][2] = 0;
948 M[3][3] = 1;
949 M[0][3] = 0;
950 M[1][3] = 0;
951 M[2][3] = 0;
952 }
953
955 {
956 return PMatrix<FRealSingle, 3, 3>(M[0][0], M[0][1], M[0][2], M[1][0], M[1][1], M[1][2], M[2][0], M[2][1], M[2][2]);
957 }
959 {
960 return M[0][0] * (M[1][1] * M[2][2] - M[1][2] * M[2][1]) - M[0][1] * (M[1][0] * M[2][2] - M[1][2] * M[2][0]) + M[0][2] * (M[1][0] * M[2][1] - M[1][1] * M[2][0]);
961 }
963 {
964 M[0][0] += Other.M[0][0];
965 M[0][1] += Other.M[0][1];
966 M[0][2] += Other.M[0][2];
967 M[1][0] += Other.M[1][0];
968 M[1][1] += Other.M[1][1];
969 M[1][2] += Other.M[1][2];
970 M[2][0] += Other.M[2][0];
971 M[2][1] += Other.M[2][1];
972 M[2][2] += Other.M[2][2];
973 return *this;
974 }
975
976 // TDOD(mlentine): This should really be a vector multiply and sum for each entry using sse
978 {
980 M[0][0] * Other[0] + M[0][1] * Other[1] + M[0][2] * Other[2],
981 M[1][0] * Other[0] + M[1][1] * Other[1] + M[1][2] * Other[2],
982 M[2][0] * Other[0] + M[2][1] * Other[1] + M[2][2] * Other[2]);
983 }
985 {
987 M[0][0] + Other.M[0][0],
988 M[1][0] + Other.M[1][0],
989 M[2][0] + Other.M[2][0],
990 M[0][1] + Other.M[0][1],
991 M[1][1] + Other.M[1][1],
992 M[2][1] + Other.M[2][1],
993 M[0][2] + Other.M[0][2],
994 M[1][2] + Other.M[1][2],
995 M[2][2] + Other.M[2][2]);
996 }
1002 {
1004 M[0][0] - Other.M[0][0],
1005 M[1][0] - Other.M[1][0],
1006 M[2][0] - Other.M[2][0],
1007 M[0][1] - Other.M[0][1],
1008 M[1][1] - Other.M[1][1],
1009 M[2][1] - Other.M[2][1],
1010 M[0][2] - Other.M[0][2],
1011 M[1][2] - Other.M[1][2],
1012 M[2][2] - Other.M[2][2]);
1013 }
1015 {
1017 -Other.M[0][0],
1018 -Other.M[1][0],
1019 -Other.M[2][0],
1020 -Other.M[0][1],
1021 -Other.M[1][1],
1022 -Other.M[2][1],
1023 -Other.M[0][2],
1024 -Other.M[1][2],
1025 -Other.M[2][2]);
1026 }
1028 {
1029 return static_cast<const UE::Math::TMatrix<FRealSingle>*>(this)->operator*(static_cast<const UE::Math::TMatrix<FRealSingle>&>(Other));
1030 }
1031 // Needs to be overridden because base version multiplies M[3][3]
1033 {
1035 M[0][0] * Other,
1036 M[1][0] * Other,
1037 M[2][0] * Other,
1038 M[0][1] * Other,
1039 M[1][1] * Other,
1040 M[2][1] * Other,
1041 M[0][2] * Other,
1042 M[1][2] * Other,
1043 M[2][2] * Other);
1044 }
1045 // Needs to be overridden because base version multiplies M[3][3]
1047 {
1048 M[0][0] *= Other;
1049 M[0][1] *= Other;
1050 M[0][2] *= Other;
1051 M[1][0] *= Other;
1052 M[1][1] *= Other;
1053 M[1][2] *= Other;
1054 M[2][0] *= Other;
1055 M[2][1] *= Other;
1056 M[2][2] *= Other;
1057 return *this;
1058 }
1064 {
1066 M[0][0] * Other.M[0] + M[0][1] * Other.M[1] + M[0][2] * Other.M[2],
1067 M[1][0] * Other.M[0] + M[1][1] * Other.M[1] + M[1][2] * Other.M[2],
1068 M[2][0] * Other.M[0] + M[2][1] * Other.M[1] + M[2][2] * Other.M[2],
1069 M[0][0] * Other.M[3] + M[0][1] * Other.M[4] + M[0][2] * Other.M[5],
1070 M[1][0] * Other.M[3] + M[1][1] * Other.M[4] + M[1][2] * Other.M[5],
1071 M[2][0] * Other.M[3] + M[2][1] * Other.M[4] + M[2][2] * Other.M[5]);
1072 }
1074 {
1076 M[0][0] - Scalar,
1077 M[1][0],
1078 M[2][0],
1079 M[0][1],
1080 M[1][1] - Scalar,
1081 M[2][1],
1082 M[0][2],
1083 M[1][2],
1084 M[2][2] - Scalar);
1085 }
1087 {
1089 M[1][1] * M[2][2] - M[2][1] * M[2][1],
1090 M[2][1] * M[2][0] - M[1][0] * M[2][2],
1091 M[1][0] * M[2][1] - M[1][1] * M[2][0],
1092 M[0][0] * M[2][2] - M[2][0] * M[2][0],
1093 M[1][0] * M[2][0] - M[0][0] * M[2][1],
1094 M[0][0] * M[1][1] - M[1][0] * M[1][0]);
1095 }
1097 {
1098 FRealSingle m10 = M[1][0] * M[1][0];
1099 FRealSingle m20 = M[2][0] * M[2][0];
1100 FRealSingle m21 = M[2][1] * M[2][1];
1101 FRealSingle c0 = M[0][0] * M[0][0] + m10 + m20;
1102 FRealSingle c1 = m10 + M[1][1] * M[1][1] + m21;
1103 FRealSingle c2 = m20 + m21 + M[2][2] * M[2][2];
1104 if (c0 > c1 && c0 > c2)
1105 {
1106 return TVector<FRealSingle, 3>(M[0][0], M[1][0], M[2][0]) / FMath::Sqrt(c0);
1107 }
1108 if (c1 > c2)
1109 {
1110 return TVector<FRealSingle, 3>(M[1][0], M[1][1], M[2][1]) / FMath::Sqrt(c1);
1111 }
1112 if (c2 > 0)
1113 {
1114 return TVector<FRealSingle, 3>(M[2][0], M[2][1], M[2][2]) / FMath::Sqrt(c2);
1115 }
1116 return TVector<FRealSingle, 3>(1, 0, 0);
1117 }
1118
1124 {
1125 return TVector<FRealSingle, 3>(M[AxisIndex][0], M[AxisIndex][1], M[AxisIndex][2]);
1126 }
1127
1133 {
1134 M[AxisIndex][0] = Axis.X;
1135 M[AxisIndex][1] = Axis.Y;
1136 M[AxisIndex][2] = Axis.Z;
1137 M[AxisIndex][3] = 0;
1138 }
1139
1146 {
1147 return TVector<FRealSingle, 3>(M[0][RowIndex], M[1][RowIndex], M[2][RowIndex]);
1148 }
1149
1156 {
1157 M[0][RowIndex] = V.X;
1158 M[1][RowIndex] = V.Y;
1159 M[2][RowIndex] = V.Z;
1160 M[3][RowIndex] = 0;
1161 }
1162
1169 {
1170 return GetAxis(ColumnIndex);
1171 }
1172
1179 {
1180 SetAxis(ColumnIndex, V);
1181 }
1182
1187 {
1188 return TVector<FRealSingle, 3>(M[0][0], M[1][1], M[2][2]);
1189 }
1190
1192 {
1193 return M[ColIndex][RowIndex];
1194 }
1195
1197 {
1198 M[ColIndex][RowIndex] = V;
1199 }
1200
1208
1209#if COMPILE_WITHOUT_UNREAL_SUPPORT
1210 // TODO(mlentine): Document which one is row and which one is column
1212 {
1214 M[0][0] * Other.M[0][0] + M[0][1] * Other.M[1][0] + M[0][2] * Other.M[2][0],
1215 M[1][0] * Other.M[0][0] + M[1][1] * Other.M[1][0] + M[1][2] * Other.M[2][0],
1216 M[2][0] * Other.M[0][0] + M[2][1] * Other.M[1][0] + M[2][2] * Other.M[2][0],
1217 M[0][0] * Other.M[0][1] + M[0][1] * Other.M[1][1] + M[0][2] * Other.M[2][1],
1218 M[1][0] * Other.M[0][1] + M[1][1] * Other.M[1][1] + M[1][2] * Other.M[2][1],
1219 M[2][0] * Other.M[0][1] + M[2][1] * Other.M[1][1] + M[2][2] * Other.M[2][1],
1220 M[0][0] * Other.M[0][2] + M[0][1] * Other.M[1][2] + M[0][2] * Other.M[2][2],
1221 M[1][0] * Other.M[0][2] + M[1][1] * Other.M[1][2] + M[1][2] * Other.M[2][2],
1222 M[2][0] * Other.M[0][2] + M[2][1] * Other.M[1][2] + M[2][2] * Other.M[2][2]);
1223 }
1224#endif
1226 {
1227 return true
1228 && (FMath::Abs(Other.M[0][0] - M[0][0]) <= Tolerance)
1229 && (FMath::Abs(Other.M[0][1] - M[0][1]) <= Tolerance)
1230 && (FMath::Abs(Other.M[0][2] - M[0][2]) <= Tolerance)
1231 && (FMath::Abs(Other.M[1][0] - M[1][0]) <= Tolerance)
1232 && (FMath::Abs(Other.M[1][1] - M[1][1]) <= Tolerance)
1233 && (FMath::Abs(Other.M[1][2] - M[1][2]) <= Tolerance)
1234 && (FMath::Abs(Other.M[2][0] - M[2][0]) <= Tolerance)
1235 && (FMath::Abs(Other.M[2][1] - M[2][1]) <= Tolerance)
1236 && (FMath::Abs(Other.M[2][2] - M[2][2]) <= Tolerance);
1237 }
1238
1239 // M[i][j] = x[i] * y[j]
1241 {
1243 X[0] * Y[0],
1244 X[1] * Y[0],
1245 X[2] * Y[0],
1246 X[0] * Y[1],
1247 X[1] * Y[1],
1248 X[2] * Y[1],
1249 X[0] * Y[2],
1250 X[1] * Y[2],
1251 X[2] * Y[2]);
1252 }
1253
1254
1257 };
1258
1260}
#define FORCEINLINE
Definition AndroidPlatform.h:140
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_KINDA_SMALL_NUMBER
Definition UnrealMathUtility.h:131
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
TVector< FRealDouble, 3 > operator*(const TVector< FRealDouble, 2 > &Other)
Definition Matrix.h:53
PMatrix(const FRealDouble x00, const FRealDouble x10, const FRealDouble x20, const FRealDouble x01, const FRealDouble x11, const FRealDouble x21)
Definition Matrix.h:43
PMatrix(const TVector< FRealDouble, 3 > &C1, const TVector< FRealDouble, 3 > &C2)
Definition Matrix.h:33
PMatrix< FRealDouble, 3, 3 > operator*(const FRealDouble Other) const
Definition Matrix.h:591
PMatrix(const FRealDouble x00, const FRealDouble x10, const FRealDouble x20, const FRealDouble x01, const FRealDouble x11, const FRealDouble x21, const FRealDouble x02, const FRealDouble x12, const FRealDouble x22)
Definition Matrix.h:450
PMatrix(const TVector< FRealDouble, 3 > &Vector)
Definition Matrix.h:409
PMatrix()
Definition Matrix.h:380
TVector< FRealDouble, 3 > LargestColumnNormalized() const
Definition Matrix.h:655
PMatrix< FRealDouble, 3, 3 > operator*=(const FRealDouble Other)
Definition Matrix.h:605
PMatrix< FRealDouble, 3, 3 > GetTransposed() const
Definition Matrix.h:513
FORCEINLINE TVector< FRealDouble, 3 > GetAxis(int32 AxisIndex) const
Definition Matrix.h:682
PMatrix(const UE::Math::TMatrix< FRealDouble > &Other)
Definition Matrix.h:386
PMatrix(UE::Math::TMatrix< FRealDouble > &&Other)
Definition Matrix.h:382
PMatrix< FRealDouble, 3, 3 > & operator+=(const PMatrix< FRealDouble, 3, 3 > &Other)
Definition Matrix.h:521
PMatrix< FRealDouble, 3, 3 > SymmetricCofactorMatrix() const
Definition Matrix.h:645
static PMatrix< FRealDouble, 3, 3 > FromDiagonal(const TVector< FRealDouble, 3 > &D)
Definition Matrix.h:763
friend PMatrix< FRealDouble, 3, 3 > operator-(const PMatrix< FRealDouble, 3, 3 > &Other)
Definition Matrix.h:573
static const PMatrix< FRealDouble, 3, 3 > Zero
Definition Matrix.h:813
PMatrix(const UE::Math::TMatrix< FRealSingle > &Other)
Definition Matrix.h:384
FORCEINLINE void SetAxis(int32 AxisIndex, const TVector< FRealDouble, 3 > &Axis)
Definition Matrix.h:691
PMatrix< FRealDouble, 3, 3 > operator*(const PMatrix< FRealDouble, 3, 3 > &Other) const
Definition Matrix.h:586
FORCEINLINE TVector< FRealDouble, 3 > GetRow(int32 RowIndex) const
Definition Matrix.h:704
PMatrix< FRealDouble, 3, 2 > operator*(const PMatrix< FRealDouble, 3, 2 > &Other) const
Definition Matrix.h:622
friend PMatrix< FRealDouble, 3, 3 > operator*(const FRealDouble OtherF, const PMatrix< FRealDouble, 3, 3 > &OtherM)
Definition Matrix.h:618
FORCEINLINE TVector< FRealDouble, 3 > GetColumn(int32 ColumnIndex) const
Definition Matrix.h:727
static const PMatrix< FRealDouble, 3, 3 > Identity
Definition Matrix.h:814
FORCEINLINE void SetRow(int32 RowIndex, const TVector< FRealDouble, 3 > &V)
Definition Matrix.h:714
bool Equals(const PMatrix< FRealDouble, 3, 3 > &Other, FRealDouble Tolerance=UE_KINDA_SMALL_NUMBER) const
Definition Matrix.h:784
PMatrix< FRealDouble, 3, 3 > SubtractDiagonal(const FRealDouble Scalar) const
Definition Matrix.h:632
static PMatrix< FRealDouble, 3, 3 > OuterProduct(const TVector< FRealDouble, 3 > &X, const TVector< FRealDouble, 3 > &Y)
Definition Matrix.h:799
PMatrix< FRealDouble, 3, 3 > operator-(const PMatrix< FRealDouble, 3, 3 > &Other) const
Definition Matrix.h:560
FRealDouble Determinant() const
Definition Matrix.h:517
FORCEINLINE TVector< FRealDouble, 3 > GetDiagonal() const
Definition Matrix.h:745
PMatrix(const FRealDouble x00, const FRealDouble x11, const FRealDouble x22)
Definition Matrix.h:388
FORCEINLINE FRealDouble GetAt(int32 RowIndex, int32 ColIndex) const
Definition Matrix.h:750
PMatrix(const FRealDouble x00, const FRealDouble x10, const FRealDouble x20, const FRealDouble x11, const FRealDouble x21, const FRealDouble x22)
Definition Matrix.h:429
PMatrix< FRealDouble, 3, 3 > operator+(const PMatrix< FRealDouble, 3, 3 > &Other) const
Definition Matrix.h:543
FORCEINLINE void SetColumn(int32 ColumnIndex, const TVector< FRealDouble, 3 > &V)
Definition Matrix.h:737
PMatrix(const FRealDouble x)
Definition Matrix.h:471
friend PMatrix< FRealDouble, 3, 3 > operator+(const PMatrix< FRealDouble, 3, 3 > &Other)
Definition Matrix.h:556
FORCEINLINE void SetAt(int32 RowIndex, int32 ColIndex, FRealDouble V)
Definition Matrix.h:755
PMatrix(const TVector< FRealDouble, 3 > &C1, const TVector< FRealDouble, 3 > &C2, const TVector< FRealDouble, 3 > &C3)
Definition Matrix.h:492
TVector< FRealDouble, 3 > operator*(const TVector< FRealDouble, 3 > &Other) const
Definition Matrix.h:536
PMatrix< FRealDouble, 4, 4 > operator*(const PMatrix< FRealDouble, 4, 4 > &Other) const
Definition Matrix.h:369
PMatrix()
Definition Matrix.h:332
PMatrix(const FRealDouble x00, const FRealDouble x10, const FRealDouble x20, const FRealDouble x30, const FRealDouble x01, const FRealDouble x11, const FRealDouble x21, const FRealDouble x31, const FRealDouble x02, const FRealDouble x12, const FRealDouble x22, const FRealDouble x32, const FRealDouble x03, const FRealDouble x13, const FRealDouble x23, const FRealDouble x33)
Definition Matrix.h:334
PMatrix(const UE::Math::TMatrix< FRealDouble > &Matrix)
Definition Matrix.h:354
TVector< FRealSingle, 2 > TransformPosition(const TVector< FRealSingle, 2 > &Other) const
Definition Matrix.h:227
friend PMatrix< FRealSingle, 3, 2 > operator*(const PMatrix< FRealSingle, 3, 2 > &First, const PMatrix< FRealSingle, 2, 2 > &Other)
Definition Matrix.h:269
FRealSingle Determinant() const
Definition Matrix.h:249
PMatrix< FRealSingle, 2, 2 > GetTransposed() const
Definition Matrix.h:244
PMatrix(const FRealSingle x00, const FRealSingle x10, const FRealSingle x01, const FRealSingle x11)
Definition Matrix.h:202
PMatrix< FRealSingle, 2, 2 > Inverse() const
Definition Matrix.h:234
PMatrix< FRealSingle, 2, 2 > operator*(const PMatrix< FRealSingle, 2, 2 > &Other) const
Definition Matrix.h:260
FORCEINLINE FRealSingle GetAt(int32 RowIndex, int32 ColIndex) const
Definition Matrix.h:254
PMatrix(const FRealSingle x00, const FRealSingle x10, const FRealSingle x11)
Definition Matrix.h:210
PMatrix< FRealSingle, 2, 2 > SubtractDiagonal(const FRealSingle Scalar) const
Definition Matrix.h:218
friend PMatrix< FRealSingle, 3, 2 > operator*(const FRealSingle OtherF, const PMatrix< FRealSingle, 3, 2 > &OtherM)
Definition Matrix.h:128
PMatrix(const FRealSingle x00)
Definition Matrix.h:88
PMatrix(const FRealSingle x00, const FRealSingle x10, const FRealSingle x20, const FRealSingle x01, const FRealSingle x11, const FRealSingle x21)
Definition Matrix.h:78
PMatrix< FRealSingle, 3, 2 > operator+(const PMatrix< FRealSingle, 3, 2 > &Other) const
Definition Matrix.h:117
PMatrix(const TVector< FRealSingle, 3 > &C1, const TVector< FRealSingle, 3 > &C2)
Definition Matrix.h:68
TVector< FRealSingle, 3 > operator*(const TVector< FRealSingle, 2 > &Other)
Definition Matrix.h:98
PMatrix< FRealSingle, 3, 2 > operator-(const PMatrix< FRealSingle, 3, 2 > &Other) const
Definition Matrix.h:106
FORCEINLINE TVector< FRealSingle, 3 > GetDiagonal() const
Definition Matrix.h:1186
PMatrix< FRealSingle, 3, 3 > operator*(const PMatrix< FRealSingle, 3, 3 > &Other) const
Definition Matrix.h:1027
FORCEINLINE FRealSingle GetAt(int32 RowIndex, int32 ColIndex) const
Definition Matrix.h:1191
FORCEINLINE void SetRow(int32 RowIndex, const TVector< FRealSingle, 3 > &V)
Definition Matrix.h:1155
FORCEINLINE void SetAxis(int32 AxisIndex, const TVector< FRealSingle, 3 > &Axis)
Definition Matrix.h:1132
bool Equals(const PMatrix< FRealSingle, 3, 3 > &Other, FRealSingle Tolerance=UE_KINDA_SMALL_NUMBER) const
Definition Matrix.h:1225
friend PMatrix< FRealSingle, 3, 3 > operator*(const FRealSingle OtherF, const PMatrix< FRealSingle, 3, 3 > &OtherM)
Definition Matrix.h:1059
TVector< FRealSingle, 3 > LargestColumnNormalized() const
Definition Matrix.h:1096
PMatrix(const FRealSingle x00, const FRealSingle x10, const FRealSingle x20, const FRealSingle x11, const FRealSingle x21, const FRealSingle x22)
Definition Matrix.h:870
FORCEINLINE TVector< FRealSingle, 3 > GetAxis(int32 AxisIndex) const
Definition Matrix.h:1123
PMatrix< FRealSingle, 3, 3 > SymmetricCofactorMatrix() const
Definition Matrix.h:1086
PMatrix< FRealSingle, 3, 3 > SubtractDiagonal(const FRealSingle Scalar) const
Definition Matrix.h:1073
static PMatrix< FRealSingle, 3, 3 > OuterProduct(const TVector< FRealSingle, 3 > &X, const TVector< FRealSingle, 3 > &Y)
Definition Matrix.h:1240
PMatrix< FRealSingle, 3, 3 > GetTransposed() const
Definition Matrix.h:954
PMatrix(UE::Math::TMatrix< FRealSingle > &&Other)
Definition Matrix.h:823
PMatrix(const UE::Math::TMatrix< FRealDouble > &Other)
Definition Matrix.h:827
PMatrix(const FRealSingle x)
Definition Matrix.h:912
PMatrix< FRealSingle, 3, 2 > operator*(const PMatrix< FRealSingle, 3, 2 > &Other) const
Definition Matrix.h:1063
FORCEINLINE void SetColumn(int32 ColumnIndex, const TVector< FRealSingle, 3 > &V)
Definition Matrix.h:1178
PMatrix(const TVector< FRealSingle, 3 > &Vector)
Definition Matrix.h:850
static const PMatrix< FRealSingle, 3, 3 > Identity
Definition Matrix.h:1256
PMatrix< FRealSingle, 3, 3 > & operator+=(const PMatrix< FRealSingle, 3, 3 > &Other)
Definition Matrix.h:962
FORCEINLINE void SetAt(int32 RowIndex, int32 ColIndex, FRealSingle V)
Definition Matrix.h:1196
static PMatrix< FRealSingle, 3, 3 > FromDiagonal(const TVector< FRealSingle, 3 > &D)
Definition Matrix.h:1204
FORCEINLINE TVector< FRealSingle, 3 > GetRow(int32 RowIndex) const
Definition Matrix.h:1145
PMatrix< FRealSingle, 3, 3 > operator-(const PMatrix< FRealSingle, 3, 3 > &Other) const
Definition Matrix.h:1001
FRealSingle Determinant() const
Definition Matrix.h:958
static const PMatrix< FRealSingle, 3, 3 > Zero
Definition Matrix.h:1255
friend PMatrix< FRealSingle, 3, 3 > operator+(const PMatrix< FRealSingle, 3, 3 > &Other)
Definition Matrix.h:997
friend PMatrix< FRealSingle, 3, 3 > operator-(const PMatrix< FRealSingle, 3, 3 > &Other)
Definition Matrix.h:1014
FORCEINLINE TVector< FRealSingle, 3 > GetColumn(int32 ColumnIndex) const
Definition Matrix.h:1168
PMatrix(const FRealSingle x00, const FRealSingle x10, const FRealSingle x20, const FRealSingle x01, const FRealSingle x11, const FRealSingle x21, const FRealSingle x02, const FRealSingle x12, const FRealSingle x22)
Definition Matrix.h:891
PMatrix(const TVector< FRealSingle, 3 > &C1, const TVector< FRealSingle, 3 > &C2, const TVector< FRealSingle, 3 > &C3)
Definition Matrix.h:933
PMatrix()
Definition Matrix.h:821
TVector< FRealSingle, 3 > operator*(const TVector< FRealSingle, 3 > &Other) const
Definition Matrix.h:977
PMatrix(const FRealSingle x00, const FRealSingle x11, const FRealSingle x22)
Definition Matrix.h:829
PMatrix< FRealSingle, 3, 3 > operator*=(const FRealSingle Other)
Definition Matrix.h:1046
PMatrix(const UE::Math::TMatrix< FRealSingle > &Other)
Definition Matrix.h:825
PMatrix< FRealSingle, 3, 3 > operator*(const FRealSingle Other) const
Definition Matrix.h:1032
PMatrix< FRealSingle, 3, 3 > operator+(const PMatrix< FRealSingle, 3, 3 > &Other) const
Definition Matrix.h:984
PMatrix(const UE::Math::TMatrix< FRealSingle > &Matrix)
Definition Matrix.h:307
PMatrix()
Definition Matrix.h:285
PMatrix< FRealSingle, 4, 4 > operator*(const PMatrix< FRealSingle, 4, 4 > &Other) const
Definition Matrix.h:322
PMatrix(const FRealSingle x00, const FRealSingle x10, const FRealSingle x20, const FRealSingle x30, const FRealSingle x01, const FRealSingle x11, const FRealSingle x21, const FRealSingle x31, const FRealSingle x02, const FRealSingle x12, const FRealSingle x22, const FRealSingle x32, const FRealSingle x03, const FRealSingle x13, const FRealSingle x23, const FRealSingle x33)
Definition Matrix.h:287
PMatrix< FReal, 2, 2 > GetTransposed() const
Definition Matrix.h:190
PMatrix(const FReal x00, const FReal x10, const FReal x01, const FReal x11)
Definition Matrix.h:148
PMatrix< FReal, 2, 2 > Inverse() const
Definition Matrix.h:180
PMatrix< FReal, 2, 2 > SubtractDiagonal(const FReal Scalar) const
Definition Matrix.h:164
PMatrix(const FReal x00, const FReal x10, const FReal x11)
Definition Matrix.h:156
TVector< FReal, 2 > TransformPosition(const TVector< FReal, 2 > &Other) const
Definition Matrix.h:173
Definition Matrix.h:21
Definition Vector.h:41
Definition SkeletalMeshComponent.h:307
@ Y
Definition SimulationModuleBase.h:153
@ X
Definition SimulationModuleBase.h:152
FRealDouble FReal
Definition Real.h:22
float FRealSingle
Definition Real.h:14
double FRealDouble
Definition Real.h:13
FComplex operator*(const FReal Other, const FComplex Complex)
Definition Complex.h:32
PMatrix< double, 3, 3 > PMatrix33d
Definition Matrix.h:1259
Definition AdvancedWidgetsModule.cpp:13
Definition Matrix.h:43
T M[4][4]
Definition Matrix.h:49
T FReal
Definition Matrix.h:47