Box2D. Box2dGearJoint

Box2D Gear Joint

  • A gear joint is used to connect two joints together
  • Either joint can be a revolute or prismatic joint
  • You specify a gear ratio to bind the motions together

Constructor

new Box2dGearJoint(objectA, objectB, joint1, joint2, ratioopt)

Create a gear joint

Parameters:
NameTypeAttributesDefaultDescription
objectABox2dObject
objectBBox2dObject
joint1Box2dJoint
joint2Box2dJoint
ratioratio<optional>
1

Extends

  • Box2dJoint

Methods

getJoint1() → {Box2dJoint}

Get the first joint

Returns:
Type: 
Box2dJoint

getJoint2() → {Box2dJoint}

Get the second joint

Returns:
Type: 
Box2dJoint

getRatio() → {number}

Get the gear ratio

Returns:
Type: 
number

setRatio(ratio)

Set the gear ratio

Parameters:
NameTypeDescription
rationumber