当您使用 physicals_fixture_bind 将夹具绑定到实例时,这会返回绑定夹具的 "id"。您可以随时使用此函数使用此 ID 来获取绑定夹具 (而不是 " 基础 " 夹具) 的恢复 (" 弹力 " 属性) 值。
physics_get_restitution(fixture)
参数 | 类型 | 描述 |
---|---|---|
fixture | Physics Fixture ID | 绑定装置的 ID |
var rest = physics_get_restitution(fix_id);
physics_set_restitution(fix_id, rest * 2);
上面的代码获取实例的绑定物理属性的当前补偿值,然后将其设置为不同的值。