Page 2 of 2
Re: How To Handle Object/Item Collision
Posted: Wed Jun 10, 2009 4:44 pm
by AerisAndMe
Welllll..... there's no magix way to know what objects are going to be colliding with what other objects. But a quad/oct - tree can improve your chances of guessing
Of course checking every object with every other object WOULD work, it would just be slower than rendering a tortoise in HD.
Implementing a quadtree (if you're in 2D) or an octree (if you're in 3D), both of which act the same way in their respective dimensions, would eliminate a whole bunch of unnecessary checks. Somewhere around here, I thought avansc posted about quadtrees.... Hrmm... Anyway, the basic idea is that you're breaking up space in which a collision between two points is possible by continually decomposing that space into quadrants (or um... octants? in 3D). i.e. an object in the top left corner of the screen doesn't have to be checked for collision with an object in the bottom right corner since they aren't in the same quadrant.
Google.
Re: How To Handle Object/Item Collision
Posted: Wed Jun 10, 2009 5:15 pm
by dandymcgee
AerisAndMe wrote:Welllll..... there's no magix way to know what objects are going to be colliding with what other objects. But a quad/oct - tree can improve your chances of guessing
Of course checking every object with every other object WOULD work, it would just be slower than rendering a tortoise in HD.
Implementing a quadtree (if you're in 2D) or an octree (if you're in 3D), both of which act the same way in their respective dimensions, would eliminate a whole bunch of unnecessary checks. Somewhere around here, I thought avansc posted about quadtrees.... Hrmm... Anyway, the basic idea is that you're breaking up space in which a collision between two points is possible by continually decomposing that space into quadrants (or um... octants? in 3D). i.e. an object in the top left corner of the screen doesn't have to be checked for collision with an object in the bottom right corner since they aren't in the same quadrant.
Google.
I read a whole ton about quadtrees, but unfortunately just like the Separating Axis Theorem, I didn't even know where to start integrating theory and project.
Re: How To Handle Object/Item Collision
Posted: Wed Jun 10, 2009 11:31 pm
by Falco Girgis
dandymcgee wrote:AerisAndMe wrote:Welllll..... there's no magix way to know what objects are going to be colliding with what other objects. But a quad/oct - tree can improve your chances of guessing
Of course checking every object with every other object WOULD work, it would just be slower than rendering a tortoise in HD.
Implementing a quadtree (if you're in 2D) or an octree (if you're in 3D), both of which act the same way in their respective dimensions, would eliminate a whole bunch of unnecessary checks. Somewhere around here, I thought avansc posted about quadtrees.... Hrmm... Anyway, the basic idea is that you're breaking up space in which a collision between two points is possible by continually decomposing that space into quadrants (or um... octants? in 3D). i.e. an object in the top left corner of the screen doesn't have to be checked for collision with an object in the bottom right corner since they aren't in the same quadrant.
Google.
I read a whole ton about quadtrees, but unfortunately just like the Separating Axis Theorem, I didn't even know where to start integrating theory and project.
It comes with a lot of experience with abstract mathematics--or in the words of Kendall, "A shitload of linear algebra."
Re: How To Handle Object/Item Collision
Posted: Thu Jun 11, 2009 1:56 am
by Lucas
AerisAndMe wrote:Somewhere around here, I thought avansc posted about quadtrees.... Hrmm...
Since it has been mentioned if anybody is too lazy to search for it, it's here
http://elysianshadows.com/phpBB3/viewto ... 765#p39765
(I assume that's the post you were talking about)
It definatly(sp?) helped me understand quadtrees a bit better, it is in a PowerPoint presentation so if you don't have PowerPoint you'll need to download the PowerPoint viewer from Microsoft's website.