2d-physics-engine
Version:
A lightweight, flexible 2D physics engine with ECS architecture, built with TypeScript
18 lines • 589 B
TypeScript
import { AABB } from './AABB';
import { Vector2 } from './Vector2';
export declare class QuadTree {
private aabb;
private maxObjects;
private points;
private nodes;
constructor(aabb: AABB, maxObjects: number);
/** Inserts a point into the quadtree. */
insert(point: Vector2): boolean;
/** Subdivides the current node into four child nodes. */
private subdivide;
/** Query points within a range. */
query(range: AABB, foundPoints?: Vector2[]): Vector2[];
/** Clears the quadtree. */
clear(): void;
}
//# sourceMappingURL=QuadTree.d.ts.map