Skip to main content

Interface: Constraint

Defined in: src/mobjects/physics/constraints.ts:32

A constraint on the physics world.

The world runs two phases each step. It calls accumulateForces in the force phase (before integration) and solvePositions in the position phase (after integration). A constraint implements only the phase it needs.

Methods​

accumulateForces()?​

optional accumulateForces(): void

Defined in: src/mobjects/physics/constraints.ts:34

Add forces to the linked bodies before integration. Optional.

Returns​

void


clone()​

clone(map): Constraint

Defined in: src/mobjects/physics/constraints.ts:38

Return a copy of this constraint with bodies remapped through map.

Parameters​

map​

Map<Body, Body>

Returns​

Constraint


solvePositions()?​

optional solvePositions(): void

Defined in: src/mobjects/physics/constraints.ts:36

Correct the linked body positions after integration. Optional.

Returns​

void