summaryrefslogtreecommitdiff
path: root/libs/JSystem/JMath/JMath.cpp
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2023-07-21 05:39:25 +0300
committerGitHub <noreply@github.com>2023-07-20 19:39:25 -0700
commit2e177620128983214229a2b897c4952e28854526 (patch)
tree54a8d9b507ba651952643a938bd3d9fd7c58f506 /libs/JSystem/JMath/JMath.cpp
parentaba19d36a571c7abe68224ca5247ab46850d69a7 (diff)
Various matches (#378)
* Maybe improve JMAEulerToQuat * JKRFileLoader OK * JUTCacheFont work * Match J3DModel::prepareShapePackets * JUTDirectFile OK * JUTDirectPrint OK * Work on JUTProcBar * Work on JUTResFont
Diffstat (limited to 'libs/JSystem/JMath/JMath.cpp')
-rw-r--r--libs/JSystem/JMath/JMath.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/JSystem/JMath/JMath.cpp b/libs/JSystem/JMath/JMath.cpp
index 5ae6b8767b..046db24b4d 100644
--- a/libs/JSystem/JMath/JMath.cpp
+++ b/libs/JSystem/JMath/JMath.cpp
@@ -38,8 +38,10 @@ void JMAEulerToQuat(s16 x, s16 y, s16 z, Quaternion* quat) {
f32 sinY = JMASSin(y / 2);
f32 sinZ = JMASSin(z / 2);
- quat->w = cosX * (cosY * cosZ) + sinX * (sinY * sinZ);
- quat->x = sinX * (cosY * cosZ) - cosX * (sinY * sinZ);
+ f32 cyz = cosY * cosZ;
+ f32 syz = sinY * sinZ;
+ quat->w = cosX * (cyz) + sinX * (syz);
+ quat->x = sinX * (cyz) - cosX * (syz);
quat->y = cosZ * (cosX * sinY) + sinZ * (sinX * cosY);
quat->z = sinZ * (cosX * cosY) - cosZ * (sinX * sinY);
}