Page 1 of 1

ApplyForce() adds excess energy

Posted: Tue Oct 28, 2008 8:21 pm
by Johnnylightbulb
Am I incorrect in thinking that the quasi-standard implementation of an "ApplyForce" method I see in physics code incorrectly adds energy to the simulation? Typically, in many engines I see:

Code: Select all

void ApplyForce(Vector3 force, Vector3 relative)
{
    this.Force += force;
    this.Torque += Vector3.Cross(relative, force);
}
Wouldn't this pattern add too much linear force when a purely torque force is applied? (When 'relative' is tangential to the COM)

I would expect that in increase in force would be less to compensate for the energy transformed into torque. Am I missing something?

Thanks :)

Re: ApplyForce() adds excess energy

Posted: Wed Oct 29, 2008 1:05 am
by Nathanael
Its a common observation, I think the best explanation can be found here: http://www.cs.cmu.edu/~baraff/sigcourse/notesd1.pdf page 29, section 5.5

Hope it help,
Nathanael.

Re: ApplyForce() adds excess energy

Posted: Wed Oct 29, 2008 1:20 am
by Johnnylightbulb
Nathanael wrote:page 29, section 5.5
Ah. I have some reading to do. Thank you very much!!

Re: ApplyForce() adds excess energy

Posted: Fri Oct 31, 2008 10:42 pm
by ewjordan
While that whole thing is probably worth reading anyways, the quick answer is that there's no requirement that the same force over the same time adds the same amount of energy; change in energy is the integral of the force over distance (dotted appropriately, of course), not time, so the answer is that over a given period of time the force is applied over a greater distance when it's applied off-center, due to the rotational motion that it adds.