I have a 2D space with objects, each object has a coordinate vector and an array of vertices relative to its coordinates, now I need an effective way to store objects, this store should be able to add and remove objects, and the most important part is collision detection:
I want to get a list of objects that have a chance to collide (close neighbor, etc.), should be quick and easy to
O([number of objects with collision chance] * log([number of all objects]))Thus, when there are no closed objects, he should do it in O(1), and not in brute force mode, just iterate over all objects in O(n).
Ask if something is unclear.
Maybe you know some kind of link on this topic or some good ideas.
Thank.
Vladp source
share