32
\$\begingroup\$

What is the difference between an application of an impulse and an application of a force in relation to a physics engine?

\$\endgroup\$

1 Answer 1

31
\$\begingroup\$

An impulse is applied instantly, so it does not depend on the time step. You would use an impulse when you want to give a fixed boost of speed to something, or the physical action happens too quickly (ex. bullets/gun ricochet, collisions, jumps, instant speed ups).

Meanwhile a force changes the speed directly proportional to the time step. You use it for things that have an over time effect (ex. gravity, long springs, air resistance).

Mathematically impulse = force * time; And for reference impulse = mass * velocity_change, force = mass * acceleration.

If you expand the first, you can check this:

  • impulse = force * time ->
  • impulse = mass * acceleration * time and since acceleration * time = velocity_change ->
  • impulse = mass * velocity_change.
\$\endgroup\$
4
  • 1
    \$\begingroup\$ Since impulse = force * time, the impulse is also time dependent (at least if you use forces to get the impulse's magnitude). Indeed, momentum or impulse is useful for applying instantaneous dramatic changes. The most popular example comes from the laws of conservation of momentum and energy: physics.ohio-state.edu/~gan/teaching/spring99/C10.pdf. \$\endgroup\$
    – teodron
    Aug 12, 2012 at 12:13
  • \$\begingroup\$ So is the implementation by Jeff Lake via Game Coding Complete 3rd Ed. Chapter 15: Collision and Simple Physics incorrect: (paraphrasing) Start with a Vector3d (or 2d depending) of forces F, Accumulate all Forces applied in a list, Accumulate All Impulses in a list add both totals to Forces, empty Impulses list, Accel = F / mass, Vel += Accel * deltaTime, Pos = Vel * time. \$\endgroup\$
    – Casey
    Aug 12, 2012 at 17:56
  • \$\begingroup\$ @Casey: that is how I do it. In my simulator I can't use the rigid body case where two bodies collide and everything works out directly. Following the Newtonian way of integrating the acceleration to find the velocity and then the position. My impulses are derived from a repulsion force (response/reaction force is a synonym in my understanding): i = F_response * DTime. You can go either ways: use the i impulse to correct the velocities after the collision, or use directly the response force. If you get the impulse from somewhere else, you canconvert it to an F_response and it works OK. \$\endgroup\$
    – teodron
    Aug 13, 2012 at 10:24
  • \$\begingroup\$ @teodron Thanks, that brings up a separate question which I'll ask ...separately. :P \$\endgroup\$
    – Casey
    Aug 13, 2012 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .