LittleJS 1.28.0

Box2D

Box2dFrictionJoint

Box2D Friction Joint

  • Used to apply top-down friction
  • Provides 2D translational friction and angular friction

Extends Box2dJoint

Constructor

new Box2dFrictionJoint(objectA, objectB, anchor, collide)box2d.js:2092

Create a friction joint

objectA Box2dObject
objectB Box2dObject
anchor Vector2 optional

World position, objectB's position if not given

collide boolean optional, default false

Methods

Inherited from Box2dJoint

Methods

getLocalAnchorA() → Vector2box2d.js:2115

Get the local anchor point relative to objectA's origin

getLocalAnchorB() → Vector2box2d.js:2119

Get the local anchor point relative to objectB's origin

getMaxForce() → numberbox2d.js:2127

Get the maximum friction force

getMaxTorque() → numberbox2d.js:2135

Get the maximum friction torque

setMaxForce(force)box2d.js:2123

Set the maximum friction force

force number
setMaxTorque(torque)box2d.js:2131

Set the maximum friction torque

torque number