From 7f031ab2cce02a56a1f8e501d38730d62a647ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Sun, 11 May 2025 01:11:16 -0300 Subject: [PATCH] fix MDL_USEROTATIONCENTER --- src/r_data/models.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/r_data/models.cpp b/src/r_data/models.cpp index 43177ef70..a2ee49573 100644 --- a/src/r_data/models.cpp +++ b/src/r_data/models.cpp @@ -200,7 +200,7 @@ VSMatrix FSpriteModelFrame::ObjectToWorldMatrix(FLevelLocals *Level, DVector3 tr // 1) Applying actor angle, pitch and roll to the model if (flags & MDL_USEROTATIONCENTER) { - objectToWorldMatrix.translate(rotationCenterX, rotationCenterY/stretch, rotationCenterZ); + objectToWorldMatrix.translate(rotationCenterX, rotationCenterZ/stretch, rotationCenterY); objectToWorldMatrix.rotate(-rotation.Yaw.Degrees(), 0, 1, 0); objectToWorldMatrix.rotate(rotation.Pitch.Degrees(), 0, 0, 1); @@ -213,7 +213,7 @@ VSMatrix FSpriteModelFrame::ObjectToWorldMatrix(FLevelLocals *Level, DVector3 tr objectToWorldMatrix.rotate(rotateOffset, xrotate, yrotate, zrotate); } - objectToWorldMatrix.translate(-rotationCenterX, -rotationCenterY/stretch, -rotationCenterZ); + objectToWorldMatrix.translate(-rotationCenterX, -rotationCenterZ/stretch, -rotationCenterY); } else { @@ -226,9 +226,9 @@ VSMatrix FSpriteModelFrame::ObjectToWorldMatrix(FLevelLocals *Level, DVector3 tr // The rotation angle is based on the elapsed time. if(flags & MDL_ROTATING) { - objectToWorldMatrix.translate(rotationCenterX, rotationCenterY/stretch, rotationCenterZ); + objectToWorldMatrix.translate(rotationCenterX, rotationCenterZ/stretch, rotationCenterY); objectToWorldMatrix.rotate(rotateOffset, xrotate, yrotate, zrotate); - objectToWorldMatrix.translate(-rotationCenterX, -rotationCenterY/stretch, -rotationCenterZ); + objectToWorldMatrix.translate(-rotationCenterX, -rotationCenterZ/stretch, -rotationCenterY); } }