summaryrefslogtreecommitdiff
path: root/src/egg/math/eggMatrix.cpp
diff options
context:
space:
mode:
authorElijah Thomas <42302100+elijah-thomas774@users.noreply.github.com>2024-10-16 15:36:02 -0400
committerGitHub <noreply@github.com>2024-10-16 15:36:02 -0400
commit26af4db82da23364961ebb440efba88846240731 (patch)
tree9cfe6a427cfe59c13c64928ccef6ba3c5ccfec21 /src/egg/math/eggMatrix.cpp
parent4543ec129ec02649b24ae0e20d8325a5f066c9b1 (diff)
update from dtk-template - clangd :) (#66)
* update from dtk-template and start work towards using clangd * include <a> -> "a" * Update build.yml * remove/add non-trivial class in union warning
Diffstat (limited to 'src/egg/math/eggMatrix.cpp')
-rw-r--r--src/egg/math/eggMatrix.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/egg/math/eggMatrix.cpp b/src/egg/math/eggMatrix.cpp
index 9fef71b7..dd171848 100644
--- a/src/egg/math/eggMatrix.cpp
+++ b/src/egg/math/eggMatrix.cpp
@@ -1,6 +1,7 @@
-#include <egg/math/eggMatrix.h>
-#include <rvl/GX.h>
-#include <rvl/MTX.h>
+#include "egg/math/eggMatrix.h"
+
+#include "rvl/GX.h" // IWYU pragma: export
+#include "rvl/MTX.h" // IWYU pragma: export
namespace EGG {
@@ -295,32 +296,31 @@ void Matrix34f::toQuat(Quatf &q) const {
}
switch (tempMax) {
- case 0:
- q.w = Math<f32>::sqrt(temp0);
- q.x = (0.25f / q.w) * (m[2][1] - m[1][2]);
- q.y = (0.25f / q.w) * (m[0][2] - m[2][0]);
- q.z = (0.25f / q.w) * (m[1][0] - m[0][1]);
- break;
- case 1:
- q.x = Math<f32>::sqrt(temp1);
- q.w = (0.25f / q.x) * (m[2][1] - m[1][2]);
- q.y = (0.25f / q.x) * (m[0][1] + m[1][0]);
- q.z = (0.25f / q.x) * (m[0][2] + m[2][0]);
- break;
- case 2:
- q.y = Math<f32>::sqrt(temp2);
- q.w = (0.25f / q.y) * (m[0][2] - m[2][0]);
- q.z = (0.25f / q.y) * (m[1][2] + m[2][1]);
- q.x = (0.25f / q.y) * (m[1][0] + m[0][1]);
- break;
- case 3:
- q.z = Math<f32>::sqrt(temp3);
- q.w = (0.25f / q.z) * (m[1][0] - m[0][1]);
- q.x = (0.25f / q.z) * (m[2][0] + m[0][2]);
- q.y = (0.25f / q.z) * (m[2][1] + m[1][2]);
- break;
- default:
- break;
+ case 0:
+ q.w = Math<f32>::sqrt(temp0);
+ q.x = (0.25f / q.w) * (m[2][1] - m[1][2]);
+ q.y = (0.25f / q.w) * (m[0][2] - m[2][0]);
+ q.z = (0.25f / q.w) * (m[1][0] - m[0][1]);
+ break;
+ case 1:
+ q.x = Math<f32>::sqrt(temp1);
+ q.w = (0.25f / q.x) * (m[2][1] - m[1][2]);
+ q.y = (0.25f / q.x) * (m[0][1] + m[1][0]);
+ q.z = (0.25f / q.x) * (m[0][2] + m[2][0]);
+ break;
+ case 2:
+ q.y = Math<f32>::sqrt(temp2);
+ q.w = (0.25f / q.y) * (m[0][2] - m[2][0]);
+ q.z = (0.25f / q.y) * (m[1][2] + m[2][1]);
+ q.x = (0.25f / q.y) * (m[1][0] + m[0][1]);
+ break;
+ case 3:
+ q.z = Math<f32>::sqrt(temp3);
+ q.w = (0.25f / q.z) * (m[1][0] - m[0][1]);
+ q.x = (0.25f / q.z) * (m[2][0] + m[0][2]);
+ q.y = (0.25f / q.z) * (m[2][1] + m[1][2]);
+ break;
+ default: break;
}
if (q.w < 0.0f) {