Fixes all the rotation bugs. (#3365)

This commit is contained in:
Pieter-Jan Briers
2021-02-22 00:46:27 +01:00
committed by GitHub
parent 6d48154617
commit 63947a6d35
26 changed files with 9344 additions and 8545 deletions

View File

@@ -34,16 +34,13 @@ namespace Content.Client.GameObjects.Components.Mobs
}
else
{
offset = _angle.RotateVec((BaseOffset, 0));
offset = _angle.RotateVec((0, -BaseOffset));
offset *= (ResetTime - _time) / ResetTime;
}
if (Owner.TryGetComponent(out ISpriteComponent spriteComponent))
{
// We have to account for rotation so the offset still checks out.
// SpriteComponent.Offset is applied before transform rotation (as expected).
var worldRotation = Owner.Transform.WorldRotation;
spriteComponent.Offset = new Angle(-worldRotation).RotateVec(offset);
spriteComponent.Offset = offset;
}
if (deleteSelf)