This was a rather successful end to my first attempt at using a quadtree to increase the performance of my collision detection. I'll certainly be using this technique in the future. There are probably some optimizations that can be made, but it was a good exercise in data structures and I used this project to learn Love2D and Lua too.
gestaltist wrote:Would you mind sharing a love file? I would love to see your implementation.
Hey, Gestaltist.
I'll have a love file to share in a day or two. I just want some time to clean up the code a bit, make sure it's properly commented, et cetera.
Thanks man! Comments are very appreciated. I have been thinking about playing with quadtrees for a while now but was always to lazy to actually implement them. Having a good implementation to learn from will be very useful to me.
gestaltist wrote:Thanks man! Comments are very appreciated. I have been thinking about playing with quadtrees for a while now but was always to lazy to actually implement them. Having a good implementation to learn from will be very useful to me.
I have already came accross some nice quadtree implementations of quadtrees on Github, in Lua.
See this one and this project.
I'd like to mention, besides this, there are also some other space partitionning techniques, like spatial hashes. The great vrld has a nice implementation of this, embed in his hardonCollider library. I have also written a library that you can find here.