Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collision Detection and Collision Response

I've been trying my hand at representing a few moving/rotating objects using androids Opengl. Now I'd like to allow them to collide and respond realistically.

Researching the issue, I can find many resources that advise me on ways to determine whether two 3d shapes are colliding in the current frame (or whether they'll be colliding in the next frame). However, I'm having trouble finding resources describing how to get information about the collision that has occurred.

For example, using convex shapes, I would want to know which vertex collided with which plane first, at what time in between the frame. This way I can know how each shape should respond in its position and rotation.

I can describe the motion of each vertex with a ray, and the motion of the planes as well, between each frame. However, I'm a little stumped as how I would use this to find their future intersections over time, and whether that would ever possible time efficiency wise. I've read of some methods for reducing the need for complex computations such as octtrees and hit boxes.

I'm fairly new to this topic, so any resources, or advice on how these problems are usually handled would be appreciated. Thank you for your time!

like image 368
groucho Avatar asked May 31 '11 06:05

groucho


2 Answers

For collision detection the solution you are looking for is called continuous collision detection, and an explanation can be found here. Detecting contacts between two bodies is relatively simple, especially if you ignore angular velocities, but if you are doing a simulation with more than two objects you will need to solve TOI globally because the order of collisions will matter and cannot be determined by examining isolated collision pairs (not so simple).

Also you should state the specific problem you are trying to solve - because finding TOI (time of impact) is not a trivial task and approximation could be perfectly valid solution in a certain scenario (eg. game simulation).

The blog I already gave links to contains approachable articles on the subject and references further reading if you want to go in to beyond.

like image 142
Rafael Munitić Avatar answered Oct 20 '22 04:10

Rafael Munitić


There are books on the subject such as:

http://realtimecollisiondetection.net/

http://www.geometrictools.com/Books/Books.html

You can also examine the source code of Open Source physics engines because they implement very detailed collisions:

http://www.ode.org/

like image 30
Ville Krumlinde Avatar answered Oct 20 '22 04:10

Ville Krumlinde