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

@@ -25,7 +25,6 @@
- type: Icon
texture: Objects/mopbucket.png
- type: Clickable
- type: BoundingBox
- type: Solution
maxVol: 500
caps: 3

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -3,7 +3,7 @@
name: Catwalk
components:
- type: Clickable
- type: BoundingBox
- type: Collidable
- type: Sprite
netsync: false
sprite: Buildings/catwalk.rsi

View File

@@ -4,7 +4,9 @@
components:
- type: Clickable
- type: Collidable
- type: BoundingBox
shapes:
- !type:PhysShapeAabb
layer: 8
- type: Icon
sprite: Buildings/computer.rsi
state: computer

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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