physics_get_restitution

当您使用 physicals_fixture_bind 将夹具绑定到实例时,这会返回绑定夹具的 "id"。您可以随时使用此函数使用此 ID 来获取绑定夹具 (而不是 " 基础 " 夹具) 的恢复 (" 弹力 " 属性) 值。

 

语法:

physics_get_restitution(fixture)

参数类型描述
fixturePhysics Fixture ID绑定装置的 ID

 

返回:

Real

 

例子:

var rest = physics_get_restitution(fix_id);
physics_set_restitution(fix_id, rest * 2);

上面的代码获取实例的绑定物理属性的当前补偿值,然后将其设置为不同的值。