19.10 Constraints

All Constraints share common accessors.

Accessors

Type

Description

bodyA

physics.Body

The first Body that the Constraint acts on

bodyB

physics.Body

The second Body that the Constaint acts on

setBiasCoef,
biasCoef

number

The fraction of error corrected each step of the simulation. Defaults to 0.1.
May not behave as expected for numbers larger than 1.0 or less than 0.

setData,
data

Lua object

A programmer-defined object

impulse

number

Calculated impulse applied by the Constraint in the last simulation step.
To convert this to the magnitude of the force, divide by the time step passed to physics.Space:step()

setMaxBias,
maxBias

number

Maximum speed the Constraint can apply error correction.
Defaults to INFINITY

setMaxForce,
maxForce

number

Magnitude of maximum force the Constraint can use to act on the two Bodies.
Defaults to INFINITY

Related Topics