Hello:

I'm trying to model a stack of boxes being pushed on a flat surface in the presence of friction and gravity. If I understand correctly, chipmunk uses the Coulomb model of friction, so the velocity of a sliding object is decelerated by a constant amount opposite the direction of travel at each simulation step. That constant amount is a function of the object's mass and friction coefficient, and the y gravity constant. Is that all correct?

This gets a little more complicated when two boxes are stacked on top of each other. My expectation is that the friction between the bottom box and the ground should be a function of the mass of the entire stack, since the boxes on top are pushing down and increasing the normal force of the bottom box against the ground. Is that also correct?

Finally, when actually simulating this scenario, I see some very strange behavior. My setup is like this: I place two boxes into the world, one on top of the other. I give them some time to settle, then apply a horizontal impulse to the bottom box. As expected, it slides slightly, with the top box also moving but not as much. The strange behavior is that after a while, the top box starts to sink into the bottom box. You can see a video of it here:

http://www.youtube.com/watch?v=I5gtDsJO7Ss

I'm running the simulation with a dt of 1e-5 and my boxes are all 1 unit in size. The boxes have friction coefficients of 1.0 and the ground has a friction coefficient of 0.1. All objects have 0 elasticity. Does anyone have any suggestions to fix this behavior?

Thanks ahead of time for your help.