Page 1 of 1

QuadTree Collision

Posted: Tue Jul 29, 2014 10:17 pm
by i_love2d_you
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. ^^

[youtube]https://www.youtube.com/watch?v=zoCdFle ... e=youtu.be[/youtube]

Re: QuadTree Collision

Posted: Tue Jul 29, 2014 10:34 pm
by veethree

Re: QuadTree Collision

Posted: Tue Jul 29, 2014 10:57 pm
by i_love2d_you
Thanks!

Re: QuadTree Collision

Posted: Wed Jul 30, 2014 6:45 am
by gestaltist
Would you mind sharing a love file? I would love to see your implementation.

Re: QuadTree Collision

Posted: Wed Jul 30, 2014 11:11 am
by i_love2d_you
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.

Re: QuadTree Collision

Posted: Wed Jul 30, 2014 10:13 pm
by gestaltist
i_love2d_you wrote:
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.

Re: QuadTree Collision

Posted: Thu Jul 31, 2014 9:25 am
by Roland_Yonaba
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.