Improve physics
This commit is contained in:
parent
c21025caf6
commit
4ad60813c9
33 changed files with 457 additions and 382 deletions
|
|
@ -7,6 +7,13 @@ export class BoundingBoxList {
|
|||
this.boundingBoxes.push(box);
|
||||
}
|
||||
|
||||
public remove(box: BoundingBoxBase) {
|
||||
this.boundingBoxes.splice(
|
||||
this.boundingBoxes.findIndex((i) => i === box),
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
public findIntersecting(box: BoundingBoxBase): Array<BoundingBoxBase> {
|
||||
return this.boundingBoxes.filter((b) => b.intersects(box));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue