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.
How To Handle Object/Item Collision
Moderator: Coders of Rage
- AerisAndMe
- ES Software Engineer
- Posts: 381
- Joined: Tue Apr 07, 2009 9:29 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: PC, SNES, PS3
- Programming Language of Choice: C/++
- Location: Madison AL
- Contact:
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: How To Handle Object/Item Collision
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.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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: How To Handle Object/Item Collision
It comes with a lot of experience with abstract mathematics--or in the words of Kendall, "A shitload of linear algebra."dandymcgee wrote: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.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.
-
- Chaos Rift Newbie
- Posts: 16
- Joined: Sun May 24, 2009 11:28 am
- Favorite Gaming Platforms: PC, SNES, Dreamcast
- Programming Language of Choice: C++
- Location: UK
Re: How To Handle Object/Item Collision
Since it has been mentioned if anybody is too lazy to search for it, it's here http://elysianshadows.com/phpBB3/viewto ... 765#p39765AerisAndMe wrote:Somewhere around here, I thought avansc posted about quadtrees.... Hrmm...
(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.
I don't see any invisible walls...