1

Sorry for this noobish question, I am new to LimeJS/Box2d.

I am trying to construct a BOX2d Revolute joint in LimeJS. Can someone provide me with a simple example illustrating the same?

Thanks

A Nice Guy
  • 2,676
  • 4
  • 30
  • 54

1 Answers1

0

Take a look at the box2d demo (at lime/demos/tests/box2d_2.js) and use this function to create a revolute joint between 2 bodies.

function createRevoluteJoint(body1, body2, anchorPoint, box2dWorld){
    var revoluteJointDef = new box2d.RevoluteJointDef(false);
    revoluteJointDef.body1 = body1;
    revoluteJointDef.body2 = body2;
    revoluteJointDef.anchorPoint = anchorPoint;

    var joint = box2dWorld.CreateJoint(revoluteJointDef);
    return joint;
}
Kevin Smyth
  • 48
  • 1
  • 5