Revert "Physics (#3452)"

This reverts commit 3e64fd56a1.
This commit is contained in:
Pieter-Jan Briers
2021-02-28 18:49:48 +01:00
parent eddec5fcce
commit 1eb0fbd8d0
211 changed files with 2560 additions and 2600 deletions

View File

@@ -0,0 +1,44 @@
#nullable enable
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
namespace Content.Shared.Physics
{
public class SlipController : VirtualController
{
[Dependency] private readonly IPhysicsManager _physicsManager = default!;
public SlipController()
{
IoCManager.InjectDependencies(this);
}
private float Decay { get; set; } = 0.95f;
public override void UpdateAfterProcessing()
{
if (ControlledComponent == null)
{
return;
}
if (_physicsManager.IsWeightless(ControlledComponent.Owner.Transform.Coordinates))
{
if (ControlledComponent.IsColliding(Vector2.Zero, false))
{
Stop();
}
return;
}
LinearVelocity *= Decay;
if (LinearVelocity.Length < 0.001)
{
Stop();
}
}
}
}