# Problem with torque in contacting bodies

This topic is 3850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### 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 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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 33
• 16
• 11
• 10
• ### Forum Statistics

• Total Topics
634123
• Total Posts
3015629
×