SpatialIndexForDestructables

Closures View source
SpatialIndexForDestructables

Native-less Lua spatial queries for destructables.

Pass a reusable ArrayList and the query fills it. The target is reset before it is populated, so one scratch list serves every call. To narrow what comes back, pass a filter rather than collecting everything and testing membership afterwards. Filters are caller-owned, and nested queries must use separate result collections. The range query intentionally matches ClosureForGroups.forDestructablesInRange: it returns the square that encloses the circle rather than applying a second distance test. Runtime-created destructables must be registered explicitly.

Types

Functions and constants

public function destructablesInRect(ArrayList<destructable> result, rect area, DestructableSpatialFilter filter)
public function destructablesInRect(ArrayList<destructable> result, rect area)
public function destructablesInRange(ArrayList<destructable> result, vec2 center, real range, DestructableSpatialFilter filter)
public function destructablesInRange(ArrayList<destructable> result, vec2 center, real range)