From 7ca13b59388c5eac52dfe5b8299eddbb38cfaa97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Tue, 22 Mar 2022 19:26:48 +0100 Subject: [PATCH] git subrepo pull (merge) lib/sead subrepo: subdir: "lib/sead" merged: "14326b350" upstream: origin: "https://github.com/open-ead/sead" branch: "master" commit: "14326b350" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596" --- lib/sead/.gitrepo | 4 ++-- lib/sead/include/math/seadMathBase.h | 6 +++--- lib/sead/include/math/seadMatrix.h | 5 +++++ lib/sead/include/math/seadMatrix.hpp | 12 ++++++++++++ lib/sead/include/math/seadMatrixCalcCommon.hpp | 15 +-------------- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/lib/sead/.gitrepo b/lib/sead/.gitrepo index 3846b4c1..920622f6 100644 --- a/lib/sead/.gitrepo +++ b/lib/sead/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/open-ead/sead branch = master - commit = 1b66e825d1927254c191028523645541b13c7eab - parent = ffcc7f659ebc9bc9d149e52bec553b906bb47369 + commit = 14326b3504f5b3909e4482820ca16a6071f3eb5e + parent = 0197ca3aba7ac2d26b978258ac5615fd35bfcd25 method = merge cmdver = 0.4.3 diff --git a/lib/sead/include/math/seadMathBase.h b/lib/sead/include/math/seadMathBase.h index d4437705..dab4ef88 100644 --- a/lib/sead/include/math/seadMathBase.h +++ b/lib/sead/include/math/seadMathBase.h @@ -74,7 +74,7 @@ struct BaseMtx33 union { T m[3][3]; - T a[9]; + std::array a; }; }; @@ -84,7 +84,7 @@ struct BaseMtx34 union { T m[3][4]; - T a[12]; + std::array a; }; }; @@ -94,7 +94,7 @@ struct BaseMtx44 union { T m[4][4]; - T a[16]; + std::array a; }; }; diff --git a/lib/sead/include/math/seadMatrix.h b/lib/sead/include/math/seadMatrix.h index 9ba4cef5..19d31a8e 100644 --- a/lib/sead/include/math/seadMatrix.h +++ b/lib/sead/include/math/seadMatrix.h @@ -283,6 +283,11 @@ const Matrix44 Matrix44::zero; template <> const Matrix44 Matrix44::ident; +template +bool operator==(const Matrix34& lhs, const Matrix34& rhs); +template +bool operator!=(const Matrix34& lhs, const Matrix34& rhs); + } // namespace sead #define SEAD_MATH_MATRIX_H_ diff --git a/lib/sead/include/math/seadMatrix.hpp b/lib/sead/include/math/seadMatrix.hpp index dfee707c..8a6d06d5 100644 --- a/lib/sead/include/math/seadMatrix.hpp +++ b/lib/sead/include/math/seadMatrix.hpp @@ -710,4 +710,16 @@ inline void Matrix44::setRow(s32 row, const Vec4& v) Matrix44CalcCommon::setRow(*this, row, v); } +template +inline bool operator==(const Matrix34& lhs, const Matrix34& rhs) +{ + return lhs.a == rhs.a; +} + +template +inline bool operator!=(const Matrix34& lhs, const Matrix34& rhs) +{ + return lhs.a != rhs.a; +} + } // namespace sead diff --git a/lib/sead/include/math/seadMatrixCalcCommon.hpp b/lib/sead/include/math/seadMatrixCalcCommon.hpp index bd16b03d..f67fef66 100644 --- a/lib/sead/include/math/seadMatrixCalcCommon.hpp +++ b/lib/sead/include/math/seadMatrixCalcCommon.hpp @@ -692,20 +692,7 @@ void Matrix33CalcCommon::toQuat(Quat& q, const Base& n) template void Matrix34CalcCommon::makeIdentity(Base& o) { - o.m[0][0] = 1; - o.m[0][1] = 0; - o.m[0][2] = 0; - o.m[0][3] = 0; - - o.m[1][0] = 0; - o.m[1][1] = 1; - o.m[1][2] = 0; - o.m[1][3] = 0; - - o.m[2][0] = 0; - o.m[2][1] = 0; - o.m[2][2] = 1; - o.m[2][3] = 0; + Matrix34CalcCommon::copy(o, Base{{{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}}}}); } #ifdef cafe