Verlet integrator + friction

女生的网名这么多〃 提交于 2019-12-10 22:16:13

问题


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?


回答1:


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




回答2:


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²



来源:https://stackoverflow.com/questions/10270875/verlet-integrator-friction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!