Class DistanceConstraint

Distance constraint.

Hierarchy (view full)

Accessors

  • get maxDistance(): number
  • Current maximum distance that constraint will try to keep bodies apart. If set to negative number, it uses initial distance between two bodies, when the joint was created. Only works when space is set to CONSTRAINT_SPACE_WORLD.

    Returns number

    • Maximum distance to keep bodies apart.

    Default Value

    -1
    
  • get minDistance(): number
  • Current minimum distance that constraint will try to keep bodies apart. If set to negative number, it uses initial distance between two bodies, when the joint was created. Only works when space is set to CONSTRAINT_SPACE_WORLD.

    Returns number

    • Minimum distance to keep bodies apart.

    Default Value

    -1
    

Methods