chore: matter body aabb
This commit is contained in:
parent
3023489d91
commit
12f87bd29d
|
@ -13,6 +13,16 @@ export class Body extends AbstractBody {
|
||||||
this.matterBody = this.constructor.bodyFromShape(shape);
|
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) {
|
applyForce(force) {
|
||||||
MatterBody.applyForce(
|
MatterBody.applyForce(
|
||||||
this.matterBody,
|
this.matterBody,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user