Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 XNA 中使用 Farseer 并使用名为 ApplyLinearImpulse() 的函数来让对象朝特定方向移动。
如何使用 Farseer 让对象自然减速?
这是通过 LinearDamping 属性实现的。
根据牛顿先生的说法,物体在受到外力作用之前会保持其状态。因此,如果您希望它停止,您将向相反方向施加力或让摩擦力为您完成。既然你说“自然”,我假设你想施加摩擦。
只要您通过 Body.Friction 属性设置了两个对象碰撞,就会应用摩擦力。
如果你想在背景上产生摩擦,有一个叫做摩擦关节的关节,它总是对身体施加摩擦,就像它在桌子上滑动一样。