Jump to content
  • Advertisement
Sign in to follow this  
BradDaBug

Confused about linear forces and rotation

This topic is 1224 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

I'm sure this has been asked 10000s of times before, but I can't find a good explanation.

 

I saw some code in Box2D for applying a linear impulse (force works similarly) that looks like this (paraphrasing the code):

ApplyImpulse(Vector2 impulse, Vector2 position)
{
    linear_velocity += impulse / mass;
    angular_velocity += Cross(impulse, position - center_of_body) / momentOfInertia;
}

But I don't understand how this works. I have a pen on my desk, and when I apply a force near the center the entire pen moves but doesn't rotate. If I apply the same force at the tip of the pen it rotates but doesn't really move. It looks like this code would handle the pushing-the-pen-near-the-center case, but move the pen way too much in the other case. But then everything that I've read says that this is correct and it's just how it works.

 

I don't get it.

Share this post


Link to post
Share on other sites
Advertisement
That is how it works. You have the wrong intuitions in the case of the pen, probably because there is too much friction involved.

This should help. Edited by Álvaro

Share this post


Link to post
Share on other sites

Thanks! Apparently my intuitions were completely wrong.

 

I still don't really get why the friction would matter. The friction is the same in both scenarios (right?) and the linear forces are the same (right?). I'm unable to intuit.

Share this post


Link to post
Share on other sites

I still don't really get why the friction would matter. The friction is the same in both scenarios (right?) and the linear forces are the same (right?)

 

 

Friction is a force, and the location of that force with respect to the center of mass is the difference. Consider a pen that has more contact area (source of friction) near its center.

 

If you push the pen in the center, you overcome the force of friction and the pen moves. There's no rotation because the forces are through the center-of-mass --> torque = 0

 

If you push the pen at one end, that force results in a torque and the pen rotates. If the pushing force isn't large enough to overcome the friction force, the pen "doesn't really move."

 

[attachment=26374:torque.png]
 

 

The friction is the same in both scenarios (right?)

 

 

Probably not. Friction is funny. There isn't any opposing friction force until you try to move the pen. And then it's equal in magnitude to the pushing force, up to a maximum value = mu * normal_force**. blink.png  Strange but true.

 

** mu = coefficient of friction between the pen's surface and the surface of the desk.

normal_force = pen-mass * gravity

 

 

and the linear forces are the same (right?)

 

 

Maybe not. You'd actually have to measure it carefully. It may be you pushed the pen until you got movement. You'd have to push a little bit harder at the center to get movement than you would at the end to get rotation. [shrug] No way to tell.

 

EDIT2: In addition, the scenario shown above ignores bunches of other stuff - the pen may roll along it's longitudinal axis and the change from static to rolling or sliding may change the coefficient of friction; rotation or rolling may change the areas of contact, changing/adding/subtracting friction, etc.

Edited by Buckeye

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!