physics_fixture_set_angular_damping


描述

如果你考虑“现实世界”中的任何旋转物体,除非有电机或空间,否则由于外力(如与其周围的空气的摩擦)的影响,它会随着时间的推移而减慢。We can use the function physics_fixture_set_angular_damping() in GameMaker Studio 2 to simulate this effect and reduce the velocity of rotation of instances in the physics world, as, without it, any rotating instance would continue to rotate infinitely. 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_angular_damping(fixture, damping)

参数 描述
fixture the index of the fixture
damping the angular damping of the fixture, usually between 0 and 1


返回:

N/A(无返回值)


例如:

physics_fixture_set_angular_damping(fix_Ball, 0.1);

The code above will set the angular damping of the fixture indexed in "fix_ball" to 0.1.