Interface Joint

A joint between two bodies that should be enforced

interface Joint {
    bodyA: number;
    bodyB: number;
    distance: number;
    elasticity: number;
    rigidity: number;
    shapeA?: number;
    shapeB?: number;
    soft: boolean;
}

Properties

bodyA: number

The ID of the first body connected to the joint

bodyB: number

The ID of the second body connected to the joint

distance: number

The distance the joint is trying to maintain

elasticity: number

Factor of how much the joint will stretch

rigidity: number

Factor of how much the joint will compress

shapeA?: number

The ID of the shape body A is connected by

shapeB?: number

The ID of the shape body B is connected by

soft: boolean

True if the joint is soft, i.e. it doesn't force movement but only applies velocities