QuadTree Collision

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
i_love2d_you
Prole
Posts: 6
Joined: Tue Jul 29, 2014 10:15 pm

QuadTree Collision

Post 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]
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: QuadTree Collision

Post by veethree »

i_love2d_you
Prole
Posts: 6
Joined: Tue Jul 29, 2014 10:15 pm

Re: QuadTree Collision

Post by i_love2d_you »

Thanks!
gestaltist
Prole
Posts: 49
Joined: Thu May 29, 2014 10:56 am

Re: QuadTree Collision

Post by gestaltist »

Would you mind sharing a love file? I would love to see your implementation.
i_love2d_you
Prole
Posts: 6
Joined: Tue Jul 29, 2014 10:15 pm

Re: QuadTree Collision

Post 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.
gestaltist
Prole
Posts: 49
Joined: Thu May 29, 2014 10:56 am

Re: QuadTree Collision

Post 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.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: QuadTree Collision

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests