# SetSpritePhysicsDensity

## Description

Sets the density value to use for the given sprite shape during physics calculations. Default value is 1.0. This affects the mass calculation for the given size of the sprite. This command will recalculate the mass and center of mass for this sprite. Use a shapeID of 0 to apply this density to all shapes or specify a shape ID greater than 0 to apply it only to that shape. Shape IDs start at 1 for the first shape.

## Definition

SetSpritePhysicsDensity( iSpriteIndex, density, shapeID )

void agk::SetSpritePhysicsDensity( UINT iSpriteIndex, float density, int shapeID )

## Parameters

- iSpriteIndex - The ID of the sprite to modify
- density - The new density value, default is 1.0
- shapeID - The ID of the shape to change, 0 to apply the value to all shapes