physics_get_restitution

This function gets the density value for a bound fixture.

Syntax:

physics_get_restitution(fixture)


Argument Description
fixture the id of the bound fixture


Returns: Real


Description

When you bind a fixture to an instance using physics_fixture_bind this returns an "id" for the bound fixture. You can use this id to get the restitution (the "bounciness" property) value of the bound fixture, not the "base" fixture, at any time using this function.


Example:

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

The code above gets the current restitution value for the bound physics properties of the instance and then sets them to a different value.


Back: Fixtures
Next: physics_set_friction
© Copyright YoYo Games Ltd. 2018 All Rights Reserved