According to the Box2D manual:
“The distance joint can also be made soft, like a spring-damper connection”
and I followed the example in that manual:
a part of my code:
distanceJointDef = new b2DistanceJointDef();
distanceJointDef.Initialize(this.bodyA, this.bodyC, this.bodyA.GetWorldCenter(), this.bodyC.GetWorldCenter());
distanceJointDef.collideConnected = false;
distanceJointDef.frequencyHZ = 25;
distanceJointDef.dampingRatio = 0.5;
this.acJoint = this.world.CreateJoint(distanceJointDef);
But the joint seems to be solid, there isn’t any spring effect at all. I remember that I’ve made one in XCode, with C++, and that worked perfectly. But in Cocos2d-html5, there may be some thing that was not correctly ported in Box2D.js.
Any suggestion please?
Thank you very much.