I want to simulate spring effect using box2djs. After a lot search i figure it that that distancejoint can be used (i am not sure). I tried the follwing code but i am not looking any joint between the body.
distance_joint = new b2DistanceJointDef();
distance_joint.body1 = Body1;
distance_joint.body2 = Body2;
distance_joint.localAnchorA = new b2Vec2(0, 0);
distance_joint.localAnchorB = new b2Vec2(0, 0);
distance_joint.length = 3;
distance_joint.collideConnected = true;
return world.CreateJoint(distance_joint);
Any idea...
Thanks