Box2D. Box2dWeldJoint

Box2D Weld Joint

  • Glues two objects together

Constructor

new Box2dWeldJoint(objectA, objectB, anchoropt, collideopt)

Create a weld joint

Parameters:
NameTypeAttributesDefaultDescription
objectABox2dObject
objectBBox2dObject
anchorVector2<optional>

World position, objectB's position if not given

collideboolean<optional>
false

Extends

  • Box2dJoint

Methods

getDampingRatio() → {number}

Get the damping ratio

Returns:
Type: 
number

getFrequency() → {number}

Get the frequency in Hertz

Returns:
Type: 
number

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

getReferenceAngle() → {number}

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

Returns:
Type: 
number

getSpringDampingRatio() → {number}

Deprecated
  • since 1.20, use getDampingRatio
Returns:
Type: 
number

setDampingRatio(ratio)

Set the damping ratio

Parameters:
NameTypeDescription
rationumber

setFrequency(hz)

Set the frequency in Hertz

Parameters:
NameTypeDescription
hznumber

setSpringDampingRatio(ratio)

Parameters:
NameTypeDescription
rationumber
Deprecated
  • since 1.20, use setDampingRatio