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.