Calculating a compensating torque

Digini
Posts: 2
Joined: Sat Jul 14, 2007 1:14 am

Calculating a compensating torque

Post by Digini »

Hi!

I have a rigid body that I would like to make upright over some period of time. So I'm trying to figure out how to calculate the necessary torque to apply that will eventually get the body to stand up.

If someone could point me in the right direction that would be great.

thanks a lot
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Calculating a compensating torque

Post by Erwin Coumans »

Digini wrote:Hi!

I have a rigid body that I would like to make upright over some period of time. So I'm trying to figure out how to calculate the necessary torque to apply that will eventually get the body to stand up.

If someone could point me in the right direction that would be great.

thanks a lot
You could use the Bullet/src/LinearMath/btTransformUtil.h to calculate the change in angular velocity, and apply a torqueImpulses to the rigidbody.

You can also use the btHingeConstraint (use hinge->setAngularOnly(true) to only effect the rotation, not position).

Hope this helps,
Erwin