import { type PhysicsBounds } from "./physicsWorld.js"; export interface SpatialGridConfig { /** Horizontal extent to index; only x/z of the bounds are used (a top-down plane). */ bounds: PhysicsBounds; /** Cell edge; tune to ≈ the query/contact radius so a hit touches ≤ 4 cells. */ cellSize: number; /** Maximum entities the index holds; fixed at construction. */ capacity: number; } /** * A uniform-grid broad-phase over the x/z plane, separate from the rigid-body sim, for cheap * same-tick proximity across hundreds–thousands of simple movers (swarm enemies). Rebuild each * tick from the caller's own position arrays, then `queryCircle` (enemies hitting the player / an * AoE) or `forEachPair` (mutual separation). Both are precise: no false negatives, no false * positives beyond the exact distance test. */ export declare class SpatialGrid { readonly cellSize: number; readonly nx: number; readonly nz: number; readonly capacity: number; private readonly minX; private readonly minZ; private readonly numCells; private readonly cellStart; private readonly cursor; private readonly sorted; private readonly cellOfBody; private xs; private zs; private entityCount; constructor(config: SpatialGridConfig); get count(): number; private cellX; private cellZ; rebuild(count: number, xs: Float32Array, zs: Float32Array): void; /** Fill `out` with every entity within `radius` of (x,z); returns the hit count (capped at `out.length`). */ queryCircle(x: number, z: number, radius: number, out: Int32Array): number; /** Invoke `cb(a, b)` once for each unordered pair within finite, nonnegative `maxDistance`, including distances larger than `cellSize`. */ forEachPair(maxDistance: number, cb: (a: number, b: number) => void): void; }