# SetSpritePhysicsRestitution

## Description

Sets the restitution (bounciness) value to use for this sprite during physics calculations. Should be in the range 0 to 1. Values greater than 1 will result in the sprite gaining energy from collisions which can cause an unstable result. By default this sets all the shapes assigned to this sprite to the same value, you can instead set it on a per shape basis by specifying a shapeID greater than 0. Shape IDs start at 1 for the first shape, with 0 meaning apply it to all shapes.

## Definition

SetSpritePhysicsRestitution( iSpriteIndex, restitution )

void agk::SetSpritePhysicsRestitution( UINT iSpriteIndex, float restitution )

SetSpritePhysicsRestitution( iSpriteIndex, restitution, shapeID )

void agk::SetSpritePhysicsRestitution( UINT iSpriteIndex, float restitution, int shapeID )

## Parameters

- iSpriteIndex - The ID of the sprite to modify.
- restitution - The new restitution value.
- shapeID - The ID of the shape to change, 0 to apply the value to all shapes