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

@@ -13,7 +13,6 @@ using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -414,7 +413,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
var startTile = gridManager.GetTileRef(entity.Transform.Coordinates);
var endTile = gridManager.GetTileRef(steeringRequest.TargetGrid);
var collisionMask = 0;
if (entity.TryGetComponent(out IPhysBody physics))
if (entity.TryGetComponent(out IPhysicsComponent physics))
{
collisionMask = physics.CollisionMask;
}
@@ -600,7 +599,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
return Vector2.Zero;
}
if (target.TryGetComponent(out IPhysBody physics))
if (target.TryGetComponent(out IPhysicsComponent physics))
{
var targetDistance = (targetPos.Position - entityPos.Position);
targetPos = targetPos.Offset(physics.LinearVelocity * targetDistance);
@@ -618,7 +617,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
/// <returns></returns>
private Vector2 CollisionAvoidance(IEntity entity, Vector2 direction, ICollection<IEntity> ignoredTargets)
{
if (direction == Vector2.Zero || !entity.TryGetComponent(out IPhysBody physics))
if (direction == Vector2.Zero || !entity.TryGetComponent(out IPhysicsComponent physics))
{
return Vector2.Zero;
}
@@ -659,7 +658,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
// if we're moving in the same direction then ignore
// So if 2 entities are moving towards each other and both detect a collision they'll both move in the same direction
// i.e. towards the right
if (physicsEntity.TryGetComponent(out IPhysBody otherPhysics) &&
if (physicsEntity.TryGetComponent(out IPhysicsComponent otherPhysics) &&
Vector2.Dot(otherPhysics.LinearVelocity, direction) > 0)
{
continue;