This looks great! precisely what I needed.
If I want collision-detection in 2D, are there other alternative algorithms? Is this the most efficient method? (for objects with finite sizes)
If I want collision-detection in 2D, are there other alternative algorithms? Is this the most efficient method? (for objects with finite sizes)
See if you can use a regular quadTree if you can find a way to do it. It'll be faster than this.
I don't know about the _most_ efficient method. That is a field of research bigger than my weekend project.
Good luck.
I like the approach of finite-size objects since I'm mostly working with creatures that collide or not based on their radius. I also have some polygons, but I can easily simplify them into circles (https://en.wikipedia.org/wiki/Smallest-circle_problem).