API Docs for: 0.6.1
Show:

DistanceConstraint Class

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

Constructor

DistanceConstraint

(
  • bodyA
  • bodyB
  • [distance]
  • [maxForce=1e6]
)

Parameters:

  • bodyA Body
  • bodyB Body
  • [distance] Number optional

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

  • [maxForce=1e6] Number optional

Methods

disable

()

Disables all equations in the constraint.

enable

()

Enables all equations in the constraint.

update

()

Update all the equations with data.

Properties

collideConnected

Boolean

Set to true if you want the bodies to collide when they are connected.

distance

Number

equations

Array

Equations to be solved in this constraint

id

Number