Damping is used to reduce the physics world velocity of instances, and differs from friction in that friction only occurs when two instances with fixtures are in contact. 模拟阻尼比摩擦要容易得多,但请注意,阻尼不是摩擦的替代品;这两个效果可以而且应该一起使用。Here is an image to illustrate damping:
Damping parameters should be between 0 and infinity, with 0 meaning no damping, and infinity meaning full damping. Normally you will use a damping value between 0 and 1, but you can use any non-negative value if required.
physics_fixture_set_linear_damping(fixture, damping)
参数 | 描述 |
---|---|
fixture | the index of the fixture |
damping | the damping of the fixture, usually between 0 and 1 |
N/A(无返回值)
physics_fixture_set_linear_damping(fix_Ball,
0.1);
The code above will set the linear damping of the fixture indexed in "fix_ball" to 0.1.