Box2D. Box2dRopeJoint

Box2D Rope Joint

  • Enforces a maximum distance between two points on two objects

Constructor

new Box2dRopeJoint(objectA, objectB, anchorA, anchorB, extraLength, collideopt)

Create a rope joint

Parameters:
NameTypeAttributesDefaultDescription
objectABox2dObject
objectBBox2dObject
anchorAVector2
anchorBVector2
extraLengthnumber0
collideboolean<optional>
false

Extends

  • Box2dJoint

Methods

getLocalAnchorA() → {Vector2}

Get the local anchor point relative to objectA's origin

Returns:
Type: 
Vector2

getLocalAnchorB() → {Vector2}

Get the local anchor point relative to objectB's origin

Returns:
Type: 
Vector2

getMaxLength() → {number}

Get the max length of the joint

Returns:
Type: 
number

setMaxLength(length)

Set the max length of the joint

Parameters:
NameTypeDescription
lengthnumber