LittleJS 1.28.0

Box2D

Box2dWeldJoint

Box2D Weld Joint

  • Glues two objects together

Extends Box2dJoint

Constructor

new Box2dWeldJoint(objectA, objectB, anchor, collide)box2d.js:2029

Create a weld joint

objectA Box2dObject
objectB Box2dObject
anchor Vector2 optional

World position, objectB's position if not given

collide boolean optional, default false

Methods

Inherited from Box2dJoint

Methods

getDampingRatio() → numberbox2d.js:2081

Get how much the weld's spring is damped, 0 for none and 1 to stop it bouncing

getFrequency() → numberbox2d.js:2073

Get the frequency in Hertz

getLocalAnchorA() → Vector2box2d.js:2057

Get the local anchor point relative to objectA's origin

getLocalAnchorB() → Vector2box2d.js:2061

Get the local anchor point relative to objectB's origin

getReferenceAngle() → numberbox2d.js:2065

Get the reference angle, objectB angle minus objectA angle in the reference state

setDampingRatio(ratio)box2d.js:2077

Set how much the weld's spring is damped, 0 for none and 1 to stop it bouncing

ratio number
setFrequency(hz)box2d.js:2069

Set the frequency in Hertz

hz number