Content update for ECS physics (#13291)

This commit is contained in:
metalgearsloth
2023-01-15 15:38:59 +11:00
committed by GitHub
parent 46d24bc36b
commit bf79d76666
61 changed files with 431 additions and 379 deletions

View File

@@ -60,7 +60,7 @@ public sealed class ThrowingSystem : EntitySystem
comp.Thrower = user;
// Give it a l'il spin.
if (!_tagSystem.HasTag(uid, "NoSpinOnThrow"))
_physics.ApplyAngularImpulse(physics, ThrowAngularImpulse);
_physics.ApplyAngularImpulse(uid, ThrowAngularImpulse, body: physics);
else
{
if (transform == null)
@@ -75,7 +75,7 @@ public sealed class ThrowingSystem : EntitySystem
_interactionSystem.ThrownInteraction(user.Value, uid);
var impulseVector = direction.Normalized * strength * physics.Mass;
_physics.ApplyLinearImpulse(physics, impulseVector);
_physics.ApplyLinearImpulse(uid, impulseVector, body: physics);
// Estimate time to arrival so we can apply OnGround status and slow it much faster.
var time = (direction / strength).Length;
@@ -109,7 +109,7 @@ public sealed class ThrowingSystem : EntitySystem
RaiseLocalEvent(physics.Owner, msg);
if (!msg.Cancelled)
_physics.ApplyLinearImpulse(userPhysics, -impulseVector * pushbackRatio);
_physics.ApplyLinearImpulse(user.Value, -impulseVector * pushbackRatio, body: userPhysics);
}
}
}