문제

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?

도움이 되었습니까?

해결책

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".

다른 팁

At the verlet integration: r(t)=2.00*r(t-dt)-1.00*r(t-2dt)+2at² change the multipliers to 1.99 and 0.99 for friction

Edit: this is more true:

r(t)=(2.00-friction_mult.)*r(t-dt)-(1.00-friction_mult.)*r(t-2dt)+at²

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top