LittleJS 1.30.1

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:2273

Create a motor joint

objectA Box2dObject
objectB Box2dObject

Methods

Inherited from Box2dJoint

Methods

getAngularOffset() → numberbox2d.js:2305

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

getCorrectionFactor() → numberbox2d.js:2329

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

getLinearOffset() → Vector2box2d.js:2297

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

getMaxForce() → numberbox2d.js:2313

Get the maximum force

getMaxTorque() → numberbox2d.js:2321

Get the maximum torque

setAngularOffset(offset)box2d.js:2301

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

offset number
setCorrectionFactor(factor)box2d.js:2325

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

factor number
setLinearOffset(offset)box2d.js:2293

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

offset Vector2
setMaxForce(force)box2d.js:2309

Set the maximum force

force number
setMaxTorque(torque)box2d.js:2317

Set the maximum torque

torque number