Sign in to follow this  
ludo8x

Bounding Box Collision

Recommended Posts

Hello everyone. I just implemented a collision detection system that make my character walk on a map using a sphere as a bounding volume. Now i want to try to do the same thing using a box instead of a sphere, but i have no idea on how to do this! Someone can help me ?? a starting help is pleasant!

Share this post


Link to post
Share on other sites
Quote:
Original post by ludo8x
Now i want to try to do the same thing using a box instead of a sphere, but i have no idea on how to do this!


You should probably google for AABB (which stands for Axially Alligned Bounding Box). You'll see that collision tests are a little more complex than it is in case of sphere but it still remains pretty simple thing to do.

Share this post


Link to post
Share on other sites
slide collisions with boxes it is, then :)

It's not gonna be easy though.

One of the methods, that I use, is using the separating axis theorem.

http://www.magic-software.com/Documentation/MethodOfSeparatingAxes.pdf
http://www.magic-software.com/Documentation/DynamicCollisionDetection.pdf
http://www.magic-software.com/Documentation/IntersectionRotatingBoxes.pdf

the test in static is easy (the first doc). Going into sliding motion is more complex, but feasable. I've made a small demo-tutorial based on that stuff. The principle is the same, but the execution is diferent. Maybe it can help you too.

http://www.gamedev.net/community/forums/topic.asp?topic_id=251638

it's in 2D, but can be easily extended in 3D.

THere are mybe some other solutions, like tracing vertices of the box against the triangles, and tracing vertices of the triangle back towards the box's faces, and tracing edges against each other, but that's a lot of maths, and not as reliable.

Anyway, hope that helps.

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