Physics Shapes (#306)

* Removed BoundingBoxComponent.

* Updated prototypes to use refactored CollidableComponent.

* Renamed ICollidable to IPhysBody.
Moved ICollidable to the Shared/Physics namespace.

* Migrated more yaml files to use PhysShapes.

* Updated YAML to use the new list-of-bodies system.

* Updated the new prototypes.

* Update submodule

* Update submodule again, whoops
This commit is contained in:
Acruid
2019-09-03 13:14:04 -07:00
committed by Pieter-Jan Briers
parent 5aafe89d95
commit 9353a060f2
34 changed files with 148 additions and 90 deletions

View File

@@ -5,8 +5,8 @@ using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Physics;
using Robust.Shared.Serialization;
using Robust.Shared.Interfaces.Physics;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Projectiles
@@ -54,7 +54,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
/// </summary>
/// <param name="collidedwith"></param>
/// <returns></returns>
bool ICollideSpecial.PreventCollide(ICollidable collidedwith)
bool ICollideSpecial.PreventCollide(IPhysBody collidedwith)
{
if (IgnoreShooter && collidedwith.Owner.Uid == Shooter)
return true;

View File

@@ -39,9 +39,9 @@ namespace Content.Server.GameObjects.Components
// after impacting the first object.
// For realism this should actually be changed when the velocity of the object is less than a threshold.
// This would allow ricochets off walls, and weird gravity effects from slowing the object.
if (collidedwith.Count > 0 && Owner.TryGetComponent(out CollidableComponent body))
if (collidedwith.Count > 0 && Owner.TryGetComponent(out CollidableComponent body) && body.PhysicsShapes.Count >= 1)
{
body.CollisionMask &= (int)~CollisionGroup.Mob;
body.PhysicsShapes[0].CollisionMask &= (int)~CollisionGroup.Mob;
body.IsScrapingFloor = true;
// KYS, your job is finished. Trigger ILand as well.