LittleJS 1.28.0

Box2D

Box2dJoint

Box2D Joint

  • Base class for Box2D joints
  • A joint is used to connect objects together
  • Angular values are clockwise like angle: joint angles and speeds, limits, motor speeds and torques

Extended by Box2dDistanceJoint, Box2dFrictionJoint, Box2dGearJoint, Box2dMotorJoint, Box2dPrismaticJoint, Box2dPulleyJoint, Box2dRevoluteJoint, Box2dRopeJoint, Box2dTargetJoint, Box2dWeldJoint, Box2dWheelJoint

Constructor

new Box2dJoint(jointDef)box2d.js:1355

Create a box2d joint, the base class is not intended to be used directly

jointDef Object

Freed once the joint is made, Box2D copies it

Members

Methods

Members

box2dJoint : Objectbox2d.js:1369

The Box2d joint, 0 once it is destroyed, as it is when either object is

Methods

destroy()box2d.js:1383

Destroy this joint

getAnchorA() → Vector2box2d.js:1410

Get the first anchor for this joint in world coordinates

getAnchorB() → Vector2box2d.js:1414

Get the second anchor for this joint in world coordinates

getCollideConnected() → booleanbox2d.js:1428

Check if the connected bodies should collide

getObjectA() → Box2dObjectbox2d.js:1402

Get the first object attached to this joint

getObjectB() → Box2dObjectbox2d.js:1406

Get the second object attached to this joint

getReactionForce(time) → Vector2box2d.js:1419

Get the reaction force on bodyB at the joint anchor over the last step

time number optional

The step length in seconds, the world steps by timeDelta

getReactionTorque(time) → numberbox2d.js:1424

Get the reaction torque on bodyB in N*m over the last step, clockwise like angle

time number optional

The step length in seconds, the world steps by timeDelta

isActive() → booleanbox2d.js:1432

Check if either connected body is active

isDestroyed() → booleanbox2d.js:1436

Check if the joint is gone, destroyed or taken along with one of its objects; its other methods can not be used then