Sign in to follow this  
m@

quadtree collision system??

Recommended Posts

m@    124
Hello. So I'm trying to work out what is the best solution to my collision detection problems. Keep in mind that this is for a 2D game that will look similar to the image below. I've read up on space partitioning but some seem over the top for what I need...? Or am I wrong. Quad trees seem like the most appropriate or maybe bounding boxes for each edge? I'm just not sure. Thanks in advance.

Share this post


Link to post
Share on other sites
Tom    352
As far as collision goes, spatial partitioning is used to determine which objects will potentially collide with one another, i.e., are they close enough to be worth a collision test. The partition itself does none of the actual processing. You can track with quad-tree sectors each of your objects inhabits (based on the object's position and size) and use that information to determine which other objects you'll need to test it against (using whatever method you want, probably rectangle or circle, or a combination of both). In other words, you only test against objects that occupy the same sectors.

Share this post


Link to post
Share on other sites
m@    124
Say I'm testing a sector for collisions. What happens if an object/edge covers more than one sector?
Do I test the whole edge/object?
thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this