Fixed incorrect offsetting for SpriteOffset.

This commit is contained in:
Major Cooke 2023-12-20 16:40:45 -06:00 committed by Rachael Alexanderson
parent e572bb8db3
commit 751ee7390b

View file

@ -424,11 +424,10 @@ bool HWSprite::CalculateVertices(HWDrawInfo *di, FVector3 *v, DVector3 *vp)
// want those calculations here. Credit to PhantomBeta for this.
if (offx || offy)
{
FAngle zero = FAngle::fromDeg(0);
FQuaternion quat = FQuaternion::FromAngles(FAngle::fromDeg(270) - di->Viewpoint.HWAngles.Yaw, di->Viewpoint.HWAngles.Pitch, FAngle::fromDeg(0));
FVector3 sideVec = quat * FVector3(0, 1, 0);
FVector3 upVec = quat * FVector3(0, 0, 1);
FVector3 res = sideVec * offx + upVec * offy;
FVector3 res = sideVec * -offx + upVec * offy;
mat.Translate(res.X, res.Z, res.Y);
}