LittleJS 1.28.0

Box2D

Box2dPinJoint

Box2D Pin Joint

  • Pins two objects together at a point, where they still turn freely, like a nail through two boards
  • A revolute joint at that point, so it holds exactly and its limits and motor work too
  • new Box2dPinJoint(objectA, objectB, pos, collide): the point defaults to objectA's position, where a revolute joint's anchor defaults to objectB's

Extends Box2dRevoluteJoint

Constructor

new Box2dPinJoint(objectA, objectB, pos, collide)box2d.js:1726

Create a pin joint

objectA Box2dObject
objectB Box2dObject
pos Vector2 optional

World position, objectA's position if not given

collide boolean optional, default false

Inherited from Box2dRevoluteJoint

Inherited from Box2dJoint