From 26af4db82da23364961ebb440efba88846240731 Mon Sep 17 00:00:00 2001 From: Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:36:02 -0400 Subject: update from dtk-template - clangd :) (#66) * update from dtk-template and start work towards using clangd * include -> "a" * Update build.yml * remove/add non-trivial class in union warning --- src/egg/math/eggMatrix.cpp | 58 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/egg/math/eggMatrix.cpp') 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 -#include -#include +#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::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::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::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::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::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::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::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::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) { -- cgit v1.2.3