Class DistanceConstraint

Constrains two bodies to be at a constant distance from each others center of mass.

Hierarchy (view full)

Constructors

  • Parameters

    • bodyA: Body
    • bodyB: Body
    • Optional distance: number

      The distance to keep. If undefined, it will be set to the current distance between bodyA and bodyB.

    • Optional maxForce: number

      The maximum force that should be applied to constrain the bodies.

    Returns DistanceConstraint

Properties

bodyA: Body

Body A.

bodyB: Body

Body B.

collideConnected: boolean

Set to false if you don't want the bodies to collide when they are connected.

distance: number

The distance to keep. If undefined, it will be set to the current distance between bodyA and bodyB

distanceEquation: ContactEquation
equations: Equation[]

Equations to be solved in this constraint.

id: number
idCounter: number

Methods

  • Disables all equations in the constraint.

    Returns void

  • Enables all equations in the constraint.

    Returns void