From b0762a3364488533a8ad9eeb93a07a9cea657496 Mon Sep 17 00:00:00 2001 From: SlamBamActionman Date: Mon, 9 Mar 2026 17:21:03 +0100 Subject: [PATCH] Fix impulse being set in world coordinates but angular velocity applied in local coordinates --- .../Physics/Systems/SharedPhysicsSystem.Components.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Components.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Components.cs index 88670635e7e..7f92246a2cd 100644 --- a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Components.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Components.cs @@ -235,7 +235,8 @@ public void ApplyLinearImpulse(EntityUid uid, Vector2 impulse, Vector2 point, Fi } SetLinearVelocity(uid, body.LinearVelocity + impulse * body._invMass, body: body); - SetAngularVelocity(uid, body.AngularVelocity + body.InvI * Vector2Helpers.Cross(point - body._localCenter, impulse), body: body); + var matrix = _transform.GetWorldMatrix(uid); + SetAngularVelocity(uid, body.AngularVelocity + body.InvI * Vector2Helpers.Cross(Vector2.Transform(point, matrix) - Vector2.Transform(body._localCenter, matrix), impulse), body: body); } #endregion