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

@@ -20,7 +20,6 @@ using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Broadphase;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -384,14 +383,15 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
projectileAngle = angle;
}
var physics = projectile.GetComponent<IPhysBody>();
physics.BodyStatus = BodyStatus.InAir;
var physics = projectile.GetComponent<IPhysicsComponent>();
physics.Status = BodyStatus.InAir;
var projectileComponent = projectile.GetComponent<ProjectileComponent>();
projectileComponent.IgnoreEntity(shooter);
projectile
.GetComponent<IPhysBody>()
.GetComponent<IPhysicsComponent>()
.EnsureController<BulletController>()
.LinearVelocity = projectileAngle.ToVec() * velocity;
projectile.Transform.LocalRotation = projectileAngle + MathHelper.PiOver2;
@@ -421,7 +421,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
private void FireHitscan(IEntity shooter, HitscanComponent hitscan, Angle angle)
{
var ray = new CollisionRay(Owner.Transform.Coordinates.ToMapPos(Owner.EntityManager), angle.ToVec(), (int) hitscan.CollisionMask);
var physicsManager = EntitySystem.Get<SharedBroadPhaseSystem>();
var physicsManager = IoCManager.Resolve<IPhysicsManager>();
var rayCastResults = physicsManager.IntersectRay(Owner.Transform.MapID, ray, hitscan.MaxLength, shooter, false).ToList();
if (rayCastResults.Count >= 1)