19.9.22 setDamping

Damping drains speed from bodies in the simulation. A value of 0.9 means that each body will lose 10% of its speed per second. Defaults to 1. This value can be overridden on a per body basis.

self = physics.Space:setDamping(d)

Parameter

Type

Description

self

in physics.Space

The input simulation Space

d

in number

The new amount of damping for the simulation Space

self

out physics.Space

The input Space is returned as the output

Amount of viscous damping to apply to the Space.

Note

May not behave as expected for d larger than 1.0 or less than 0.

Introduced in platform.apiLevel = '2.0'