Sign in to follow this  
Mister Doubt

Problem with torque in contacting bodies

Recommended Posts

Hi, for some time i wanted to make some physics-based stuff, and last week finally took the courage and made a soft body application using mass-springs and such. It has been quite fun working on it, and it's going very well. It was way easier to do it than a rigid body one, simply because we are working with non-oriented particles and linear motion only. Now i am thinking about giving my first steps in the rigid body realm, but there is a doubt that has been bothering for some time already. I never saw any book that i read covering this particular case, that, let's say, happens quite ALOT in a rigid body enviromment with multiple bodies around, specially if some are constrained. Maybe i just simple haven't read physics stuff enough (quite a few), or i simply wasn't intelligent enough to extract the meaning of the informations written in the books and find out how it apply to this particular case, but i will risk asking anyway. It's about torque in bodies which are in contact with others. I know that torque is a rotational force created by an off-center force to an object, and is related to the distance from the center of mass. Also the center of the rotation will be the CM. But now imagine this, First case: Case 1 There are those two objects A and B and gravity. The object B is constrained, meaning its immovable. There is a vertex-edge contact, if the entire object A area is made of the same material, the left side will be heavier and it will start spinning in a counterclockwise rotation Second case: Case 2 Objects A and B again, but of different shapes, gravity still exists. The object B is constrained. There is a edge-edge contact. By intuition brought to me by observation of the real world, i know the object A will start spinning in a counter-clockwise rotation around that little red point i painted (use zoom if you can't see) And that's it! By now, if you have read it, you probably have a clue what i am talking about, and if you know the anwser, or think you can enlighten me a little, don't hesitate to post! :) And thanks in advance!

Share this post


Link to post
Share on other sites
If you consider one contact point, like in your case, you will get an impulse, pointing upwards. That will generate linear and angular momentum. Something like...

A.linearVelocity += impulseVector / A.mass;
A.angularVelocity += ((contactPoint - A.centreOfGravity) x impulseVector) * A.inertiaMatrix.inverse();

that's in 3D, in 2D, the rotational component is easier (the inertia is just a real number, then angular velocity is also just a real number).

The derivation of the collision impulse vector is explained by Chris Hecker in his physics tutorials. This is where I would start.

here is an example (which is more about collision detection).

Share this post


Link to post
Share on other sites
If you draw a line from the center of mass to the point of contact, then forces (or impulses) along that line will push the object as a whole, whereas forces perpendicular to that line will cause torque and make the object spin. If you have a force that is partly along the line, and partly perpendicular to the line, then you have to break the force into 2 separate parallel and perpendicular components. Here is a diagram:


You may ask then, why does the whole object not get pushed up and to the left, since there is a force pushing it that way. The reason is, that there is also gravity pulling it down. Thus the net effect is 3 things:
1) The component of the collision force that is perpendicular to the center of mass line causes a counterclockwise torque.
2) The combination of gravity and the collision force component that is parallel to the center of mass line cause the block to fall down and to the left.

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