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?
3
Upvotes
1
u/Narcolapser May 01 '12
can you say what book you've got?
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/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.