LittleJS 1.28.0

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:1564

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:1591

Get the local anchor point relative to objectA's origin

getLocalAnchorB() → Vector2box2d.js:1595

Get the local anchor point relative to objectB's origin

getMaxLength() → numberbox2d.js:1603

Get the max length of the joint

setMaxLength(length)box2d.js:1599

Set the max length of the joint

length number