Remove every entry and bucket while retaining allocated bucket arrays.
Lookup by key, or undefined when absent.
Whether key is currently stored.
Insert or replace an entry.
A fresh key receives the next insertion-order ticket. Replacing an existing key keeps the original ticket so steering order stays stable when positions are updated in place via SpatialHash.update.
Collect payloads of every entry within radius of (cx, cy, cz).
out is cleared, then filled in insertion order. Pass excludeKey to omit
self-neighbours (typical when the query centre is an agent's own position).
Returns out for chaining.
OptionalexcludeKey: numberCollect keys of every entry within radius of (cx, cy, cz).
Same ordering rules as SpatialHash.query. Useful when payloads are looked up elsewhere (for example a parallel SoA particle pool).
OptionalexcludeKey: numberRemove an entry. Returns false when the key was not present.
Move an existing entry to a new position. Throws if the key is absent.
Fixed-capacity uniform grid for radius neighbour queries.
Generic over the payload type stored at each key — SteeringNeighbor for flocking, a pool index wrapper for particles, or
undefinedwhen only positions matter.