The core of my toy program is a collection of '2D overworlds' of sorts, each containing a set of polygons and cirles(sprites, walls and special regions).
I need to perform queries in these worlds like 'get the set of circles intersecting this region', 'get the set of obstacles in a region(circle,AABB) around this object', 'move this object by a very small step'etc.
These queries are using linear search(ie check everything in the world each time) at the moment, which is too slow to run even one world with the desired complexity(at most ~1k objects present, most objects in constant motion).
Is there a free as in beer library that can save me the trouble of coding faster queries myself? Which one would you suggest, given the small world size and multiple world support?