I am currently working on the following problem:
I have two 3D boxes which collide in one point.
So I have their Velocity-Vectors and their masses. Now my problem is, how can I calculate the boxes new velocity and rotation( axis & velocity ).
My idea to that is, that the impulse that 'acts' along the ray [CollisionPos, BoxCenter] results in translation, the rest ( 90° deg to that ray ) results in rotation of the box.
Now I'd like to know if this idea is right (and my implementation is wrong ) or were I made the mistake...
TIA Ruppi
(sorry for bad English, I'm from Germany)
3D Box Collision Response
-
- Posts: 8
- Joined: Sun Aug 05, 2007 6:20 pm
Hi,
I think your idea is not bad, it's near the solution. You have to calculate the normal of the collision. If the collision is a vertice penetrating through a face, the normal will be the normal of the face. The response to the collision will be an impulse:
k * n
where k is the magnitude of the response and n normal vector.
The new velocity of the penetrating cube (of mass A) will be
V2 = V1 + (k/massA)*n
And for the penetrated cube (of mass B):
V2 = V1 - (k/massB)*n
In fact the new velocity doesn't depend on the collision position. Only the new rotation velocity will depend on that point. For the new rotation velocity it's a little bit harder. I think this document will help you:
http://www.cs.cmu.edu/~baraff/pbm/rigid1.pdf
Also have a look here if you are interested, I think this way to handle collision is better:
http://www.gphysics.com/
I'm a beginner in physics, so I can write some mistakes. However I hope it will help you to progress. Maybe someone with more experience can answer too.
I think your idea is not bad, it's near the solution. You have to calculate the normal of the collision. If the collision is a vertice penetrating through a face, the normal will be the normal of the face. The response to the collision will be an impulse:
k * n
where k is the magnitude of the response and n normal vector.
The new velocity of the penetrating cube (of mass A) will be
V2 = V1 + (k/massA)*n
And for the penetrated cube (of mass B):
V2 = V1 - (k/massB)*n
In fact the new velocity doesn't depend on the collision position. Only the new rotation velocity will depend on that point. For the new rotation velocity it's a little bit harder. I think this document will help you:
http://www.cs.cmu.edu/~baraff/pbm/rigid1.pdf
Also have a look here if you are interested, I think this way to handle collision is better:
http://www.gphysics.com/
I'm a beginner in physics, so I can write some mistakes. However I hope it will help you to progress. Maybe someone with more experience can answer too.