Jump to content
  • Advertisement
Sign in to follow this  
OneEyed

3D Rigid Body - How to Apply Force at Offset?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

How exactly do I calculate a Velocity and an Angular Velocity when a Force is applied at an Offset Position?


float flMass = 2.0;
Vector vCenterOfMass = Vector(0,0,0);
Vector vForce = Vector(0,0,5);
Vector vOffsetPos = Vector(2,0,0);


--------
SOLVED


//Start Values
Vector vCenterOfMass = Vector(0,0,0);
Vector vForce = Vector(0,0,5);
Vector vOffsetPos = Vector(2,0,0);

//Preliminary Variable
Vector vCenterDir = vOffsetPos - vCenterOfMass;

//Force on Rigid Body
Vector vNewForce = vForce;

//Torque on Rigid Body
Vector vTorque = CrossProduct( vCenterDir, vForce );

Share this post


Link to post
Share on other sites
Advertisement
A force applied through a point not at the center of mass of a rigid body can be resolved into that same force through the center of mass plus a torque. The torque is as shown here: http://en.wikipedia.org/wiki/Torque

In that article, r is the vector from the center of mass to the point where the force is applied. Torque = the cross product r x F.

You then apply the torque to the moment of inertia of your rigid body to get angular velocity.

Share this post


Link to post
Share on other sites

A force applied through a point not at the center of mass of a rigid body can be resolved into that same force through the center of mass plus a torque. The torque is as shown here: http://en.wikipedia.org/wiki/Torque

In that article, r is the vector from the center of mass to the point where the force is applied. Torque = the cross product r x F.

You then apply the torque to the moment of inertia of your rigid body to get angular velocity.


So is this correct for a Left Handed Coordinate System?


//Start Values
Vector vCenterOfMass = Vector(0,0,0);
Vector vForce = Vector(0,0,5);
Vector vOffsetPos = Vector(2,0,0);

//Preliminary Variable
Vector vCenterDir = vOffsetPos - vCenterOfMass;

//Force on Rigid Body
Vector vNewForce = vForce;

//Torque on Rigid Body
Vector vTorque = CrossProduct( vCenterDir, vForce );


EDIT: Fixed vCenterDir

Share this post


Link to post
Share on other sites

So is this correct for a Left Handed Coordinate System?

Physics doesn't care about handedness (assuming you mean spatial handedness, which is the way the term is most often used on these forums). But yeah, I think what you have there is right (for either handedness). [Edit: Actually, it might be backwards; you can try it both ways though and see which one is right.]

Share this post


Link to post
Share on other sites
I believe jyk is correct. I don't think the handedness of the system matters if you're consistent. When you apply the torque to the moment of inertia, the correct direction of rotation will result.

NOTE: your vCenterdir points the wrong way. It needs to be from the center of mass to the offset position. As you have it, it points to the center of mass I.e., it should be vOffsetPos - vCenterOfMass. A little confusing perhaps but change the order of the subtraction. It's not critical as it will just change the direction of rotation. Confusinger and confusinger, huh?

NOTE2: Be sure to apply the torque to the moment of inertia about the center of mass. The torque must be applied to the moment of inertia about the same position to which the displaced force is applied.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!