LittleJS 1.30.1

Box2D

Box2dRopeJoint

Box2D Rope Joint

  • Enforces a maximum distance between two points on two objects

Extends Box2dJoint

Constructor

new Box2dRopeJoint(objectA, objectB, anchorA, anchorB, extraLength, collide)box2d.js:1610

Create a rope joint

objectA Box2dObject
objectB Box2dObject
anchorA Vector2 optional

World position, objectA's position if not given

anchorB Vector2 optional

World position, objectB's position if not given

extraLength number optional, default 0
collide boolean optional, default false

Methods

Inherited from Box2dJoint

Methods

getLocalAnchorA() → Vector2box2d.js:1638

Get the local anchor point relative to objectA's origin

getLocalAnchorB() → Vector2box2d.js:1642

Get the local anchor point relative to objectB's origin

getMaxLength() → numberbox2d.js:1650

Get the max length of the joint

setMaxLength(length)box2d.js:1646

Set the max length of the joint

length number