physicsgame-physicsverlet-integration

Verlet integrator + friction


I have been following "A Verlet based approach for 2D game physics" on Gamedev.net and I have written something similar.

The problem I am having is that the boxes slide along the ground too much. How can I add a simple rested state thing where the boxes will have more friction and only slide a tiny bit?


Solution

  • Just introduce a small, constant acceleration on moving objects that points in the direction opposite to the motion. And make sure it can't actually reverse the motion; if you detect that in an integration step, just set the velocity to zero.

    If you want to be more realistic, the acceleration should derive from a force which is proportional to the normal force between the object and the surface it's sliding on.

    You can find this in any basic physics text, as "kinetic friction" or "sliding friction".