Rotate wallsprite objects 90 degrees to match SRB2's papersprite behavior

This commit is contained in:
spherallic 2023-11-07 16:38:34 +01:00
parent b3b327a6c3
commit 7fda81ac57

View file

@ -378,11 +378,13 @@ namespace CodeImp.DoomBuilder.VisualModes
// Similar to FLATSPRITE but is not affected by pitch. // Similar to FLATSPRITE but is not affected by pitch.
case ThingRenderMode.WALLSPRITE: case ThingRenderMode.WALLSPRITE:
transform = Matrix.Scaling((float)thing.ScaleX, (float)thing.ScaleX, (float)thing.ScaleY); transform = Matrix.Scaling((float)thing.ScaleX, (float)thing.ScaleX, (float)thing.ScaleY);
float paperspriteangle = (float)(thing.Angle + Angle2D.PIHALF);
// Apply roll? // Apply roll?
if(thing.Roll != 0) if(thing.Roll != 0)
{ {
rotation = Matrix.RotationY((float)-thing.RollRad) * Matrix.RotationZ((float)thing.Angle); rotation = Matrix.RotationY((float)-thing.RollRad) * Matrix.RotationZ(paperspriteangle);
if(info.RollCenter) if(info.RollCenter)
transform *= Matrix.Translation((float)-centerx, (float)-centerx, (float)-centerz) * rotation * Matrix.Translation((float)centerx, (float)centerx, (float)centerz); transform *= Matrix.Translation((float)-centerx, (float)-centerx, (float)-centerz) * rotation * Matrix.Translation((float)centerx, (float)centerx, (float)centerz);
else else
@ -390,7 +392,7 @@ namespace CodeImp.DoomBuilder.VisualModes
} }
else else
{ {
transform *= Matrix.RotationZ((float)thing.Angle); transform *= Matrix.RotationZ(paperspriteangle);
} }
// Apply transform // Apply transform