fix MDL_USEROTATIONCENTER

This commit is contained in:
Ricardo Luís Vaz Silva 2025-05-11 01:11:16 -03:00 committed by Nash Muhandes
commit 7f031ab2cc

View file

@ -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);
}
}