API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classQuadtree
Generic recursive spatial index used by the engine's `InteractionSystem` to accelerate per-frame hit-testing of scene nodes. Items are inserted with their axis-aligned bounding box; the tree automatically subdivides into four quadrants (NW/NE/SW/SE) when a node accumulates more than `maxItems` entries and the current depth is below `maxDepth`. Items that span multiple quadrants are kept at the current node rather than duplicated. The tree is persistent: `insert` and `remove` modify the tree in place without full rebuilds. Call `clear()` for bulk reset, or `destroy()` to release all memory including child rectangles.
import { Quadtree } from '@codexo/exojs'Generic recursive spatial index used by the engine's `InteractionSystem` to accelerate per-frame hit-testing of scene nodes.
Items are inserted with their axis-aligned bounding box; the tree automatically subdivides into four quadrants (NW/NE/SW/SE) when a node accumulates more than `maxItems` entries and the current depth is below `maxDepth`. Items that span multiple quadrants are kept at the current node rather than duplicated.
The tree is persistent: `insert` and `remove` modify the tree in place without full rebuilds. Call `clear()` for bulk reset, or `destroy()` to release all memory including child rectangles.
new(bounds: RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…, maxItems: number, maxDepth: number, depth: number): Quadtree<T>clear(): voiddestroy(): voidqueryPoint(x: number, y: number, results: QuadtreeItemAn item stored in a Quadtree. Carries an axis-aligned bounding box and an arbitrary `payload`.<T>[]): QuadtreeItemAn item stored in a Quadtree. Carries an axis-aligned bounding box and an arbitrary `payload`.<T>[]queryRect(rect: RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…, results: QuadtreeItemAn item stored in a Quadtree. Carries an axis-aligned bounding box and an arbitrary `payload`.<T>[]): QuadtreeItemAn item stored in a Quadtree. Carries an axis-aligned bounding box and an arbitrary `payload`.<T>[]