LittleJS 1.28.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:2216

Create a motor joint

objectA Box2dObject
objectB Box2dObject

Methods

Inherited from Box2dJoint

Methods

getAngularOffset() → numberbox2d.js:2247

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

getCorrectionFactor() → numberbox2d.js:2271

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

getLinearOffset() → Vector2box2d.js:2239

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

getMaxForce() → numberbox2d.js:2255

Get the maximum force

getMaxTorque() → numberbox2d.js:2263

Get the maximum torque

setAngularOffset(offset)box2d.js:2243

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

offset number
setCorrectionFactor(factor)box2d.js:2267

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

factor number
setLinearOffset(offset)box2d.js:2235

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

offset Vector2
setMaxForce(force)box2d.js:2251

Set the maximum force

force number
setMaxTorque(torque)box2d.js:2259

Set the maximum torque

torque number