API Docs for: 0.4.0
Show:

DistanceConstraint Class

Constraint that tries to keep the distance between two bodies constant.

Constructor

DistanceConstraint

(
  • bodyA
  • bodyB
  • dist
  • maxForce
)

Parameters:

  • bodyA Body
  • bodyB Body
  • dist Number

    The distance to keep between the bodies.

  • maxForce Number

Item Index

Properties

Methods

getMaxForce

() Number

Get the max force

Returns:

Number:

setMaxForce

(
  • f
)

Set the max force to be used

Parameters:

  • f Number

update

()

Update the constraint equations. Should be done if any of the bodies changed position, before solving.

Properties

distance

Number

The distance to keep.