The project is great, and code is very nice...but what is the license? If you think others could benefit, perhaps consider putting it in an open source repo with a license of some kind. Right now, nobody else can use the code, since the absence of a license means no copy/paste allowed :)
If anyone want to use it, I've put it out under the MIT License (available now in the updated source).
However I think most people will look at the ideas involved and implement it in there own way as I've made a few assumptions about the structure of the objects being put in the tree.
I wrote this for a small game I'm updating, which has about 30 objects colliding. However in my situation because it has so few objects the overhead is greater than the time saved. This system works really well when there are many objects.
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.
I'm also working on a 2D game. I end up with hundreds of objects so maybe this solution will make more sense in my case. I have to run benchmarks...
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).
5 comments
[ 4.6 ms ] story [ 22.8 ms ] threadHowever I think most people will look at the ideas involved and implement it in there own way as I've made a few assumptions about the structure of the objects being put in the tree.
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).