LittleJS 1.31.0

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

Extends Box2dJoint

Constructor

new Box2dMotorJoint(objectA, objectB)box2d.js:2357

Create a motor joint

objectA Box2dObject
objectB Box2dObject

Methods

Inherited from Box2dJoint

Methods

getAngularOffset() → numberbox2d.js:2389

Get the target angular offset, objectB angle minus objectA angle, clockwise like angle

getCorrectionFactor() → numberbox2d.js:2413

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

getLinearOffset() → Vector2box2d.js:2381

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

getMaxForce() → numberbox2d.js:2397

Get the maximum force

getMaxTorque() → numberbox2d.js:2405

Get the maximum torque

setAngularOffset(offset)box2d.js:2385

Set the target angular offset, objectB angle minus objectA angle, clockwise like angle

offset number
setCorrectionFactor(factor)box2d.js:2409

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

factor number
setLinearOffset(offset)box2d.js:2377

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

offset Vector2
setMaxForce(force)box2d.js:2393

Set the maximum force

force number
setMaxTorque(torque)box2d.js:2401

Set the maximum torque

torque number