diff --git a/packages/physics/matter/body.js b/packages/physics/matter/body.js index eabce0a..d5b2dac 100644 --- a/packages/physics/matter/body.js +++ b/packages/physics/matter/body.js @@ -13,6 +13,16 @@ export class Body extends AbstractBody { this.matterBody = this.constructor.bodyFromShape(shape); } + get aabb() { + const bounds = this.matterBody.bounds; + return [ + bounds.min.x, + bounds.min.y, + bounds.max.x - bounds.min.x, + bounds.max.y - bounds.min.y, + ]; + } + applyForce(force) { MatterBody.applyForce( this.matterBody,