Reference

setRestitution()

Description

Set the restitution of the body, which define itself by the "spring" effect occuring when two bodies. A value of 1 would be a pool ball. The default is 0, which mean no restitution. For exemple, use this function to simulate a falling ball.

Exemples

PPBox myBox = new PPBox(20, 30);
myBody.setRestitution(0.5);
world.add(myBox);

Syntax

myBody.setRestitution(restitution);

Parameters

restitution ->

float : the restitution value of the body, which should be between 0 (no restitution) and 1 (pool ball).