Bounding Box Collision

Started by
3 comments, last by oliii 19 years, 7 months ago
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!
Advertisement
bounding volume against what? Doing intersections or swept tests?

http://www.realtimerendering.com/int/

that's for intersections.


Everything is better with Metal.

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.

___Quote:Know where basis goes, know where rest goes.
I want to "walk" on a map, so i'll have to calculate collision, sliding vector, ecc (using a bounding box)
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.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement