Box2D. Box2dRopeJoint

Box2D Rope Joint

  • Enforces a maximum distance between two points on two objects

Constructor

new Box2dRopeJoint(objectA, objectB, anchorAopt, anchorBopt, extraLengthopt, collideopt)

Create a rope joint

Parameters:
NameTypeAttributesDefaultDescription
objectABox2dObject
objectBBox2dObject
anchorAVector2<optional>

World position, objectA's position if not given

anchorBVector2<optional>

World position, objectB's position if not given

extraLengthnumber<optional>
0
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