UNPKG

@iamnotstone/aabb-tree

Version:

Basic implementation of the AABB-Tree (Axis Aligned Box Bounding Tree)

17 lines (16 loc) 563 B
import AABBNode from './AABBNode'; import Vector3 from './Vector3'; import IAABBShape from './IAABBShape'; import { Vector2 } from 'src'; export default class AABBTree { private rootNode?; private shapeToNodeMap; constructor(); AddShape(shape: IAABBShape): void; RemoveShape(shape: IAABBShape): void; GetShapesOverlappingWithPoint(point: Vector3 | Vector2): IAABBShape[]; GetShapesOverlappingWithShape(shape: IAABBShape): IAABBShape[]; GetAllNodes(): AABBNode[]; private nodeIterator; private removeNode; }