From 9353a060f2d8720c19d74787996951625871dc61 Mon Sep 17 00:00:00 2001 From: Acruid Date: Tue, 3 Sep 2019 13:14:04 -0700 Subject: [PATCH] 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 --- Content.Server/AI/WanderProcessor.cs | 6 ++- .../Projectiles/ProjectileComponent.cs | 4 +- .../Projectiles/ThrownItemComponent.cs | 4 +- .../EntitySystems/Click/InteractionSystem.cs | 4 +- .../GameObjects/EntitySystems/HandsSystem.cs | 7 +++- Content.Shared/Physics/CollisionGroup.cs | 18 +++++--- Resources/Prototypes/Entities/Janitor.yml | 1 - .../Weapons/Projectiles/projectiles.yml | 12 +++--- .../Entities/buildings/airlock_base.yml | 11 ++--- .../Entities/buildings/asteroid.yml | 4 +- .../Prototypes/Entities/buildings/catwalk.yml | 2 +- .../Entities/buildings/computers.yml | 4 +- .../Entities/buildings/fuel_tank.yml | 8 ++-- .../Entities/buildings/furniture.yml | 8 ++-- .../Prototypes/Entities/buildings/girder.yml | 5 ++- .../Prototypes/Entities/buildings/lathe.yml | 5 ++- .../Entities/buildings/lighting.yml | 5 +-- .../Entities/buildings/low_wall.yml | 4 +- .../Prototypes/Entities/buildings/power.yml | 42 +++++++++++++------ .../buildings/storage/closet_base.yml | 8 ++-- .../Entities/buildings/storage/crate_base.yml | 9 ++-- .../Prototypes/Entities/buildings/table.yml | 5 ++- .../Prototypes/Entities/buildings/turret.yml | 6 +-- .../Entities/buildings/vending_machines.yml | 4 +- .../Prototypes/Entities/buildings/walls.yml | 4 +- .../Prototypes/Entities/buildings/windows.yml | 5 ++- .../Prototypes/Entities/items/item_base.yml | 9 ++-- .../Prototypes/Entities/items/powercells.yml | 6 ++- .../Prototypes/Entities/items/teleporters.yml | 5 ++- .../Entities/markers/construction_ghost.yml | 4 +- Resources/Prototypes/Entities/mobs/human.yml | 11 +++-- .../Prototypes/Entities/mobs/observer.yml | 2 - Resources/Prototypes/Entities/water_tank.yml | 4 +- RobustToolbox | 2 +- 34 files changed, 148 insertions(+), 90 deletions(-) diff --git a/Content.Server/AI/WanderProcessor.cs b/Content.Server/AI/WanderProcessor.cs index c766446e53..714bc523b3 100644 --- a/Content.Server/AI/WanderProcessor.cs +++ b/Content.Server/AI/WanderProcessor.cs @@ -5,6 +5,7 @@ using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.Chat; using Content.Shared.Physics; using Robust.Server.AI; +using Robust.Server.GameObjects; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; @@ -12,6 +13,7 @@ using Robust.Shared.Interfaces.Physics; using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics; using Robust.Shared.Utility; namespace Content.Server.AI @@ -122,8 +124,8 @@ namespace Content.Server.AI var entWorldPos = SelfEntity.Transform.WorldPosition; - if (SelfEntity.TryGetComponent(out var bounds)) - entWorldPos = bounds.WorldAABB.Center; + if (SelfEntity.TryGetComponent(out var bounds)) + entWorldPos = ((IPhysBody) bounds).WorldAABB.Center; var rngState = GenSeed(); for (var i = 0; i < 3; i++) // you get 3 chances to find a place to walk diff --git a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs index 263672830a..f0e1a82ea0 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs @@ -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 /// /// /// - bool ICollideSpecial.PreventCollide(ICollidable collidedwith) + bool ICollideSpecial.PreventCollide(IPhysBody collidedwith) { if (IgnoreShooter && collidedwith.Owner.Uid == Shooter) return true; diff --git a/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs index 4d3e716150..53de7d9274 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs @@ -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. diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 0c98ead8f5..bdb8f4b863 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -329,9 +329,9 @@ namespace Content.Server.GameObjects.EntitySystems } // Check if ClickLocation is in object bounds here, if not lets log as warning and see why - if (attacked.TryGetComponent(out BoundingBoxComponent boundingBox)) + if (attacked.TryGetComponent(out ICollidableComponent collideComp)) { - if (!boundingBox.WorldAABB.Contains(coordinates.ToWorld(_mapManager).Position)) + if (!collideComp.WorldAABB.Contains(coordinates.ToWorld(_mapManager).Position)) { Logger.WarningS("system.interaction", $"Player {player.Name} clicked {attacked.Name} outside of its bounding box component somehow"); diff --git a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs index 79bdc6b00d..ed0818374a 100644 --- a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs @@ -17,6 +17,7 @@ using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; +using Robust.Shared.Physics; using Robust.Shared.Players; namespace Content.Server.GameObjects.EntitySystems @@ -170,7 +171,11 @@ namespace Content.Server.GameObjects.EntitySystems if (!throwEnt.TryGetComponent(out ThrownItemComponent projComp)) { projComp = throwEnt.AddComponent(); - colComp.CollisionMask |= (int)CollisionGroup.Mob; + + if(colComp.PhysicsShapes.Count == 0) + colComp.PhysicsShapes.Add(new PhysShapeAabb()); + + colComp.PhysicsShapes[0].CollisionMask |= (int)CollisionGroup.Mob; colComp.IsScrapingFloor = false; } diff --git a/Content.Shared/Physics/CollisionGroup.cs b/Content.Shared/Physics/CollisionGroup.cs index 1cedeb6e83..3ab378e67a 100644 --- a/Content.Shared/Physics/CollisionGroup.cs +++ b/Content.Shared/Physics/CollisionGroup.cs @@ -1,17 +1,23 @@ using System; +using JetBrains.Annotations; namespace Content.Shared.Physics { /// /// Defined collision groups for the physics system. /// - [Flags] + [Flags, PublicAPI] public enum CollisionGroup { - None = 0, - Grid = 1, // Walls - Mob = 2, // Mobs, like the player or NPCs - Fixture = 4, // wall fixtures, like APC or posters - Items = 8 // Items on the ground + None = 0, + Grid = 1 << 0, // Walls + Mob = 1 << 1, // Mobs, like the player or NPCs + Fixture = 1 << 2, // wall fixtures, like APC or posters + Items = 1 << 3, // Items on the ground + Furniture = 1 << 4, // Tables, machines + + // 32 possible groups + MobMask = Grid | Mob | Furniture, + AllMask = -1, } } diff --git a/Resources/Prototypes/Entities/Janitor.yml b/Resources/Prototypes/Entities/Janitor.yml index b5f799b554..1e6f53880f 100644 --- a/Resources/Prototypes/Entities/Janitor.yml +++ b/Resources/Prototypes/Entities/Janitor.yml @@ -25,7 +25,6 @@ - type: Icon texture: Objects/mopbucket.png - type: Clickable - - type: BoundingBox - type: Solution maxVol: 500 caps: 3 diff --git a/Resources/Prototypes/Entities/Weapons/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Weapons/Projectiles/projectiles.yml index 3850e480ff..d98a381e8b 100644 --- a/Resources/Prototypes/Entities/Weapons/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Weapons/Projectiles/projectiles.yml @@ -10,16 +10,18 @@ #rotation: -180 - type: Icon texture: Objects/Projectiles/bullet.png - - type: BoundingBox - aabb: -0.2,-0.2,0.2,0.2 + - type: Collidable + hard: false + shapes: + - !type:PhysShapeAabb + bounds: "-0.2,-0.2,0.2,0.2" + layer: 1 + mask: 3 - type: Physics edgeslide: false - type: Projectile damages: Brute: 20 - - type: Collidable - hard: false - mask: 3 - type: entity id: ProjectileBullet diff --git a/Resources/Prototypes/Entities/buildings/airlock_base.yml b/Resources/Prototypes/Entities/buildings/airlock_base.yml index 0412bcd78e..f4339c752b 100644 --- a/Resources/Prototypes/Entities/buildings/airlock_base.yml +++ b/Resources/Prototypes/Entities/buildings/airlock_base.yml @@ -20,14 +20,11 @@ sprite: Buildings/airlock_basic.rsi state: closed - - type: BoundingBox - # This AABB isn't the full tile because.. - # If it is, airlocks collide with walls and other airlocks causing them to never close. - # yeah... - # TODO: Fix that. - aabb: -0.45, -0.45, 0.45, 0.45 - type: Collidable - mask: 2 + shapes: + - !type:PhysShapeAabb + mask: 2 + layer: 16 - type: Door - type: Appearance visuals: diff --git a/Resources/Prototypes/Entities/buildings/asteroid.yml b/Resources/Prototypes/Entities/buildings/asteroid.yml index e7ebfd4780..74e27a3a11 100644 --- a/Resources/Prototypes/Entities/buildings/asteroid.yml +++ b/Resources/Prototypes/Entities/buildings/asteroid.yml @@ -10,8 +10,10 @@ - type: Icon sprite: Buildings/Walls/asteroid_rock.rsi state: 0 - - type: BoundingBox - type: Collidable + shapes: + - !type:PhysShapeAabb + layer: 1 - type: Damageable - type: Destructible thresholdvalue: 100 diff --git a/Resources/Prototypes/Entities/buildings/catwalk.yml b/Resources/Prototypes/Entities/buildings/catwalk.yml index 1763009a78..b7e0a650a1 100644 --- a/Resources/Prototypes/Entities/buildings/catwalk.yml +++ b/Resources/Prototypes/Entities/buildings/catwalk.yml @@ -3,7 +3,7 @@ name: Catwalk components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite netsync: false sprite: Buildings/catwalk.rsi diff --git a/Resources/Prototypes/Entities/buildings/computers.yml b/Resources/Prototypes/Entities/buildings/computers.yml index 4b1cb78cd5..9de6036e27 100644 --- a/Resources/Prototypes/Entities/buildings/computers.yml +++ b/Resources/Prototypes/Entities/buildings/computers.yml @@ -4,7 +4,9 @@ components: - type: Clickable - type: Collidable - - type: BoundingBox + shapes: + - !type:PhysShapeAabb + layer: 8 - type: Icon sprite: Buildings/computer.rsi state: computer diff --git a/Resources/Prototypes/Entities/buildings/fuel_tank.yml b/Resources/Prototypes/Entities/buildings/fuel_tank.yml index d4a6605fef..ebb665f877 100644 --- a/Resources/Prototypes/Entities/buildings/fuel_tank.yml +++ b/Resources/Prototypes/Entities/buildings/fuel_tank.yml @@ -10,10 +10,12 @@ texture: Buildings/weldtank.png - type: Clickable - - type: BoundingBox - aabb: "-0.5,-0.25,0.5,0.25" - type: Collidable - mask: 3 + shapes: + - !type:PhysShapeAabb + bounds: "-0.5,-0.25,0.5,0.25" + mask: 19 + layer: 16 IsScrapingFloor: true - type: Physics mass: 15 diff --git a/Resources/Prototypes/Entities/buildings/furniture.yml b/Resources/Prototypes/Entities/buildings/furniture.yml index a5c08f096c..dac90cd29c 100644 --- a/Resources/Prototypes/Entities/buildings/furniture.yml +++ b/Resources/Prototypes/Entities/buildings/furniture.yml @@ -3,7 +3,7 @@ id: stool components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite sprite: Buildings/furniture.rsi state: stool_base @@ -17,7 +17,7 @@ id: chairOfficeLight components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite sprite: Buildings/furniture.rsi state: officechair_white @@ -30,7 +30,7 @@ id: chairOfficeDark components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite sprite: Buildings/furniture.rsi state: officechair_dark @@ -43,7 +43,7 @@ id: chair components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite sprite: Buildings/furniture.rsi state: chair diff --git a/Resources/Prototypes/Entities/buildings/girder.yml b/Resources/Prototypes/Entities/buildings/girder.yml index d1407c5229..6cd7343df8 100644 --- a/Resources/Prototypes/Entities/buildings/girder.yml +++ b/Resources/Prototypes/Entities/buildings/girder.yml @@ -8,8 +8,11 @@ - type: Icon texture: Buildings/wall_girder.png - - type: BoundingBox - type: Collidable + shapes: + - !type:PhysShapeAabb + mask: 19 + layer: 1 - type: Damageable - type: Destructible thresholdvalue: 50 diff --git a/Resources/Prototypes/Entities/buildings/lathe.yml b/Resources/Prototypes/Entities/buildings/lathe.yml index e47498093a..d17cd313be 100644 --- a/Resources/Prototypes/Entities/buildings/lathe.yml +++ b/Resources/Prototypes/Entities/buildings/lathe.yml @@ -9,8 +9,11 @@ - type: Icon sprite: Buildings/autolathe.rsi state: idle - - type: BoundingBox - type: Collidable + shapes: + - !type:PhysShapeAabb + mask: 19 + layer: 16 - type: SnapGrid offset: Center - type: Lathe diff --git a/Resources/Prototypes/Entities/buildings/lighting.yml b/Resources/Prototypes/Entities/buildings/lighting.yml index f9679aa2b3..0b1aab7107 100644 --- a/Resources/Prototypes/Entities/buildings/lighting.yml +++ b/Resources/Prototypes/Entities/buildings/lighting.yml @@ -3,7 +3,7 @@ name: "Unpowered Light" components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sound - type: Sprite sprite: Buildings/light_tube.rsi @@ -29,7 +29,7 @@ parent: wall_light components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite sprite: Buildings/light_tube.rsi state: off @@ -53,7 +53,6 @@ parent: wall_light components: - type: Clickable - - type: BoundingBox - type: Sprite sprite: Buildings/light_small.rsi state: off diff --git a/Resources/Prototypes/Entities/buildings/low_wall.yml b/Resources/Prototypes/Entities/buildings/low_wall.yml index 7394d08de8..a572215869 100644 --- a/Resources/Prototypes/Entities/buildings/low_wall.yml +++ b/Resources/Prototypes/Entities/buildings/low_wall.yml @@ -14,8 +14,10 @@ sprite: Buildings/low_wall.rsi state: metal - - type: BoundingBox - type: Collidable + shapes: + - !type:PhysShapeAabb + layer: 1 - type: Damageable - type: Destructible thresholdvalue: 100 diff --git a/Resources/Prototypes/Entities/buildings/power.yml b/Resources/Prototypes/Entities/buildings/power.yml index f47d27f500..88a0601af5 100644 --- a/Resources/Prototypes/Entities/buildings/power.yml +++ b/Resources/Prototypes/Entities/buildings/power.yml @@ -4,7 +4,7 @@ description: Transfers power, avoid letting things come down it components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite netsync: false drawdepth: BelowFloor @@ -40,9 +40,12 @@ description: A portal to hell which summons power from the nether components: - type: Clickable - - type: BoundingBox - aabb: -0.5, -0.5, 0.3, 0.5 - type: Collidable + shapes: + - !type:PhysShapeAabb + bounds: "-0.5, -0.5, 0.3, 0.5" + mask: 19 + layer: 16 - type: Sprite texture: Objects/generator.png - type: Icon @@ -55,7 +58,11 @@ description: Supplies power directly to nearby objects components: - type: Clickable - - type: BoundingBox + - type: Collidable + shapes: + - !type:PhysShapeAabb + mask: 19 + layer: 4 - type: Sprite drawdepth: WallMountedItems texture: Objects/provider.png @@ -96,8 +103,10 @@ interfaces: - key: enum.ApcUiKey.Key type: ApcBoundUserInterface - - type: BoundingBox - aabb: -0.25, -0.25, 0.25, 0.3 + - type: Collidable + shapes: + - !type:PhysShapeAabb + bounds: "-0.25, -0.25, 0.25, 0.3" - type: Sound - type: entity @@ -106,9 +115,12 @@ description: Stores power in its super-magnetic cells components: - type: Clickable - - type: BoundingBox - aabb: -0.5, -0.5, 0.5, 0.5 - type: Collidable + shapes: + - !type:PhysShapeAabb + bounds: "-0.5, -0.5, 0.5, 0.5" + mask: 19 + layer: 16 - type: Sprite netsync: false sprite: Buildings/smes.rsi @@ -143,9 +155,12 @@ description: A monstrosity that does nothing but suck up power from the nearby wires components: - type: Clickable - - type: BoundingBox - aabb: -0.5, -0.25, 0.5, 0.25 - type: Collidable + shapes: + - !type:PhysShapeAabb + bounds: "-0.5, -0.25, 0.5, 0.25" + mask: 19 + layer: 16 - type: Sprite texture: Objects/wiredmachine.png - type: Icon @@ -161,9 +176,12 @@ description: A terrifying monstrosity that sucks up power from the wireless transmitters, Tesla would be proud components: - type: Clickable - - type: BoundingBox - aabb: -0.5, -0.25, 0.5, 0.25 - type: Collidable + shapes: + - !type:PhysShapeAabb + bounds: "-0.5, -0.25, 0.5, 0.25" + mask: 19 + layer: 16 - type: Sprite texture: Objects/wirelessmachine.png - type: Icon diff --git a/Resources/Prototypes/Entities/buildings/storage/closet_base.yml b/Resources/Prototypes/Entities/buildings/storage/closet_base.yml index 6223c880e5..aab29d3654 100644 --- a/Resources/Prototypes/Entities/buildings/storage/closet_base.yml +++ b/Resources/Prototypes/Entities/buildings/storage/closet_base.yml @@ -16,10 +16,12 @@ state: generic_door - type: Clickable - - type: BoundingBox - aabb: "-0.5,-0.25,0.5,0.25" - type: Collidable - mask: 3 + shapes: + - !type:PhysShapeAabb + bounds: "-0.5,-0.25,0.5,0.25" + mask: 19 + layer: 16 IsScrapingFloor: true - type: Physics mass: 25 diff --git a/Resources/Prototypes/Entities/buildings/storage/crate_base.yml b/Resources/Prototypes/Entities/buildings/storage/crate_base.yml index 7de66823e1..295b4f5158 100644 --- a/Resources/Prototypes/Entities/buildings/storage/crate_base.yml +++ b/Resources/Prototypes/Entities/buildings/storage/crate_base.yml @@ -16,14 +16,17 @@ state: crate - type: Clickable - - type: BoundingBox - aabb: -0.4, -0.4, 0.4, 0.4 - - type: Physics mass: 25 Anchored: false - type: Collidable + shapes: + - !type:PhysShapeAabb + bounds: "-0.4, -0.4, 0.4, 0.4" + layer: 16 + mask: 19 + - type: EntityStorage Capacity: 60 - type: PlaceableSurface diff --git a/Resources/Prototypes/Entities/buildings/table.yml b/Resources/Prototypes/Entities/buildings/table.yml index f39c868f29..68dd8fdb5a 100644 --- a/Resources/Prototypes/Entities/buildings/table.yml +++ b/Resources/Prototypes/Entities/buildings/table.yml @@ -12,8 +12,11 @@ sprite: Buildings/table_solid.rsi state: plain_preview - - type: BoundingBox - type: Collidable + shapes: + - !type:PhysShapeAabb + mask: 19 + layer: 16 - type: SnapGrid offset: Center diff --git a/Resources/Prototypes/Entities/buildings/turret.yml b/Resources/Prototypes/Entities/buildings/turret.yml index 9228c1d6d5..e7ef300acb 100644 --- a/Resources/Prototypes/Entities/buildings/turret.yml +++ b/Resources/Prototypes/Entities/buildings/turret.yml @@ -3,7 +3,7 @@ name: Turret Base components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite texture: Buildings/TurrBase.png @@ -12,7 +12,7 @@ name: Turret (Gun) components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite drawdepth: WallMountedItems texture: Buildings/TurrTop.png @@ -26,7 +26,7 @@ name: Turret (Light) components: - type: Clickable - - type: BoundingBox + - type: Collidable - type: Sprite drawdepth: WallMountedItems texture: Buildings/TurrLamp.png diff --git a/Resources/Prototypes/Entities/buildings/vending_machines.yml b/Resources/Prototypes/Entities/buildings/vending_machines.yml index 54f890e871..2e77d934de 100644 --- a/Resources/Prototypes/Entities/buildings/vending_machines.yml +++ b/Resources/Prototypes/Entities/buildings/vending_machines.yml @@ -13,8 +13,10 @@ - type: Icon sprite: Buildings/VendingMachines/empty.rsi state: normal - - type: BoundingBox - type: Collidable + shapes: + - !type:PhysShapeAabb + layer: 8 - type: SnapGrid offset: Center - type: Damageable diff --git a/Resources/Prototypes/Entities/buildings/walls.yml b/Resources/Prototypes/Entities/buildings/walls.yml index cb67bbb9f0..3ffd329b3f 100644 --- a/Resources/Prototypes/Entities/buildings/walls.yml +++ b/Resources/Prototypes/Entities/buildings/walls.yml @@ -8,8 +8,10 @@ drawdepth: Walls - type: Icon state: full - - type: BoundingBox - type: Collidable + shapes: + - !type:PhysShapeAabb + layer: 1 - type: Damageable - type: Destructible thresholdvalue: 100 diff --git a/Resources/Prototypes/Entities/buildings/windows.yml b/Resources/Prototypes/Entities/buildings/windows.yml index 550b606c84..f29ab5f7d0 100644 --- a/Resources/Prototypes/Entities/buildings/windows.yml +++ b/Resources/Prototypes/Entities/buildings/windows.yml @@ -13,8 +13,11 @@ sprite: Buildings/window.rsi state: window0 - - type: BoundingBox - type: Collidable + shapes: + - !type:PhysShapeAabb + bounds: "-0.5, -0.5, 0.3, 0.5" + layer: 1 - type: Damageable - type: Destructible thresholdvalue: 100 diff --git a/Resources/Prototypes/Entities/items/item_base.yml b/Resources/Prototypes/Entities/items/item_base.yml index b5be445067..0cfdb35d9d 100644 --- a/Resources/Prototypes/Entities/items/item_base.yml +++ b/Resources/Prototypes/Entities/items/item_base.yml @@ -5,11 +5,12 @@ - type: Item Size: 5 - type: Clickable - - type: BoundingBox - aabb: "-0.25,-0.25,0.25,0.25" - type: Collidable - mask: 5 - layer: 8 + shapes: + - !type:PhysShapeAabb + bounds: "-0.25,-0.25,0.25,0.25" + mask: 5 + layer: 8 IsScrapingFloor: true - type: Physics mass: 5 diff --git a/Resources/Prototypes/Entities/items/powercells.yml b/Resources/Prototypes/Entities/items/powercells.yml index 7e50d9e86e..39afa131b3 100644 --- a/Resources/Prototypes/Entities/items/powercells.yml +++ b/Resources/Prototypes/Entities/items/powercells.yml @@ -3,8 +3,10 @@ abstract: true parent: BaseItem components: - - type: BoundingBox - aabb: -0.15,-0.3,0.2,0.3 + - type: Collidable + shapes: + - !type:PhysShapeAabb + bounds: "-0.15,-0.3,0.2,0.3" - type: PowerCell - type: Appearance - type: Sprite diff --git a/Resources/Prototypes/Entities/items/teleporters.yml b/Resources/Prototypes/Entities/items/teleporters.yml index ef924aad20..f73c3e8cb9 100644 --- a/Resources/Prototypes/Entities/items/teleporters.yml +++ b/Resources/Prototypes/Entities/items/teleporters.yml @@ -50,9 +50,10 @@ description: "Portal to another location" components: - type: Collidable + shapes: + - !type:PhysShapeAabb + mask: 10 - type: Portal - - type: BoundingBox - aabb: "-0.25,-0.25,0.25,0.25" - type: Sprite netsync: false sprite: "Effects/portal.rsi" diff --git a/Resources/Prototypes/Entities/markers/construction_ghost.yml b/Resources/Prototypes/Entities/markers/construction_ghost.yml index 568dbe84ea..7c1c143415 100644 --- a/Resources/Prototypes/Entities/markers/construction_ghost.yml +++ b/Resources/Prototypes/Entities/markers/construction_ghost.yml @@ -7,7 +7,7 @@ layers: - shader: unshaded - type: ConstructionGhost - - type: BoundingBox + - type: Collidable - type: Clickable baseshader: unshaded selectionshader: selection_outline_unshaded @@ -18,5 +18,5 @@ components: - type: Sprite - type: Construction - - type: BoundingBox + - type: Collidable - type: Clickable diff --git a/Resources/Prototypes/Entities/mobs/human.yml b/Resources/Prototypes/Entities/mobs/human.yml index fc390c9609..81404f4f87 100644 --- a/Resources/Prototypes/Entities/mobs/human.yml +++ b/Resources/Prototypes/Entities/mobs/human.yml @@ -36,16 +36,15 @@ sprite: Mob/human.rsi state: male - - type: BoundingBox - aabb: "-0.35,-0.35,0.35,0.35" - - type: Physics mass: 85 - type: Collidable - mask: 3 - layer: 2 - DebugColor: "#0000FF" + shapes: + - !type:PhysShapeAabb + bounds: "-0.5,-0.25,-0.05,0.25" + mask: 19 + layer: 2 - type: Input context: "human" diff --git a/Resources/Prototypes/Entities/mobs/observer.yml b/Resources/Prototypes/Entities/mobs/observer.yml index 28cbf23009..8e3ecc669f 100644 --- a/Resources/Prototypes/Entities/mobs/observer.yml +++ b/Resources/Prototypes/Entities/mobs/observer.yml @@ -8,8 +8,6 @@ mass: 5 - type: Eye zoom: 0.5, 0.5 - - type: BoundingBox - aabb: "-0.5,-0.25,-0.05,0.25" - type: Input context: "ghost" - type: Examiner diff --git a/Resources/Prototypes/Entities/water_tank.yml b/Resources/Prototypes/Entities/water_tank.yml index 27b1620c11..75ffcab301 100644 --- a/Resources/Prototypes/Entities/water_tank.yml +++ b/Resources/Prototypes/Entities/water_tank.yml @@ -11,11 +11,11 @@ texture: Buildings/watertank.png - type: Clickable - - type: BoundingBox - aabb: "-0.5,-0.25,0.5,0.25" - type: Collidable mask: 3 layer: 1 + shape: + bounds: "-0.5,-0.25,0.5,0.25" IsScrapingFloor: true - type: Physics mass: 15 diff --git a/RobustToolbox b/RobustToolbox index 5fee08e68b..f2eb035ed8 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 5fee08e68be2230016de0935ab5b7c0ebd72a08c +Subproject commit f2eb035ed8e667b58b319ba33254bd2863d5ce78