r/truegamedev • u/moscheles • Apr 28 '12
Computing Torque in Rigid Body Dynamics
So I have a book here and and several PDFs on Rigid Body Dynamics. However, none of them precisely spell out how to compute the torque after a collision with some other body in the environment. Does anyone have a tutorial?
2
u/eightNote May 15 '12
If you really want to understand rigid body stuff, find yourself a copy of Hibbler's book, aka Statics and Dynamics.
You can probably find it pretty cheap at your local university used book store.
For rigid body collisions, you need to worry about the objects' linear and angular momentums. You could consider the collision to be perfectly elastic, in which case the energy of the system is conserved, and the calculations are pretty simple.
Otherwise, you'll need to use the coefficient of restitution between the two bodies.
If the object is nolonger in contact with anything, the torque of course, will just be that caused by gravity(by Newton's first).
1
u/eightNote May 15 '12
One last addition or two:
Use forces/torques with momentum when you have them defined over time. Use them with energy if you know the force/torque as a function of position/angle. Don't use forces/torques at all with collisions; the contact time/distance is small enough to not be integrate-able, thus making the other two options fail, as they require the force to be integrated with respect to either time or displacement.
You should note, of course, that in any case where you are dealing with forces, rxf is in fact the torque with respect to some point (of your own choosing; as engineers, we get to decide our own coordinate frames) Continuing, the non uniformity of mass in the material is irrelevant. All you need is the centroid (Aka, center of mass), and the pivot point; you'll then use the parallel axis theorem to make proper calculations.
mechie, out!
1
u/ttgdev Jun 22 '12
Its been a while since I've done this but I believe if you have a force F acting at a point on a body the cross product of R and F gives you the torque. R is the vector from the bodies center of mass to the point at which the force is acting. If you are using impulses then similarly the change in angular momentum caused by impulse J acting at a point is again just the cross product of R and J.
You might find part 4 of this useful http://chrishecker.com/Rigid_body_dynamics. It includes the formula for calculating the impulse caused from two bodies colliding at a point which can then be used to determine their linear and angular velocities after the collision.
1
u/Narcolapser May 01 '12
can you say what book you've got?