diff options
| author | Joshua Vandaƫle <joshua@vandaele.software> | 2026-06-28 08:33:40 +0200 |
|---|---|---|
| committer | Joshua Vandaƫle <joshua@vandaele.software> | 2026-07-13 02:32:33 +0200 |
| commit | 6dcb0817a2cd1a507dbf5e3c42bf13623b5b5cae (patch) | |
| tree | 3da2430b2edd92a2af41ee010b82da2b8ef09968 /Source/Core/Common/Matrix.cpp | |
| parent | 774200dcf4ccea148ef357cc8cf86d8eab4446da (diff) | |
MathUtil: C++20/23 modernisations
I've also created DegreesToRadians/RadiansToDegrees utility functions since there was a lot of repeated code
Diffstat (limited to 'Source/Core/Common/Matrix.cpp')
| -rw-r--r-- | Source/Core/Common/Matrix.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/Core/Common/Matrix.cpp b/Source/Core/Common/Matrix.cpp index 9c75487111..92de573f87 100644 --- a/Source/Core/Common/Matrix.cpp +++ b/Source/Core/Common/Matrix.cpp @@ -4,8 +4,7 @@ #include "Common/Matrix.h" #include <cmath> - -#include "Common/MathUtil.h" +#include <numbers> namespace { @@ -136,7 +135,7 @@ Vec3 FromQuaternionToEuler(const Quaternion& q) const float sinp = 2 * (qw * qy - qz * qx); if (std::abs(sinp) >= 1) - result.y = std::copysign(MathUtil::PI / 2, sinp); // use 90 degrees if out of range + result.y = std::copysign(std::numbers::pi / 2, sinp); // use 90 degrees if out of range else result.y = std::asin(sinp); |
