Box2D. Box2dMotorJoint

Box2D Motor Joint

  • Controls the relative motion between two objects
  • Typical usage is to control the movement of a object with respect to the ground

Constructor

new Box2dMotorJoint(objectA, objectB)

Create a motor joint

Parameters:
NameTypeDescription
objectABox2dObject
objectBBox2dObject

Extends

  • Box2dJoint

Methods

getAngularOffset() → {number}

Get the target angular offset

Returns:
Type: 
number

getCorrectionFactor() → {number}

Get the position correction factor in the range [0,1]

Returns:
Type: 
number

getLinearOffset() → {Vector2}

Get the target linear offset, in frame A, in meters.

Returns:
Type: 
Vector2

getMaxForce() → {number}

Get the maximum friction force

Returns:
Type: 
number

getMaxTorque() → {number}

Get the maximum torque

Returns:
Type: 
number

setAngularOffset(offset)

Set the target angular offset

Parameters:
NameTypeDescription
offsetnumber

setCorrectionFactor(factor)

Set the position correction factor in the range [0,1]

Parameters:
NameTypeDescription
factornumber

setLinearOffset(offset)

Set the target linear offset, in frame A, in meters.

Parameters:
NameTypeDescription
offsetVector2

setMaxForce(force)

Set the maximum friction force

Parameters:
NameTypeDescription
forcenumber

setMaxTorque(torque)

Set the maximum torque

Parameters:
NameTypeDescription
torquenumber