WIP
This commit is contained in:
parent
24cc572e47
commit
345e183e34
30 changed files with 628 additions and 187 deletions
13
frontend/src/scripts/physics/containers/bounding-box-list.ts
Normal file
13
frontend/src/scripts/physics/containers/bounding-box-list.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { BoundingBoxBase } from './bounding-box-base';
|
||||
|
||||
export class BoundingBoxList {
|
||||
constructor(private boundingBoxes: Array<BoundingBoxBase> = []) {}
|
||||
|
||||
public insert(box: BoundingBoxBase) {
|
||||
this.boundingBoxes.push(box);
|
||||
}
|
||||
|
||||
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