b2DistanceJoint Class
A distance joint constrains two points on two bodies to remain at a fixed distance from each other.
Example:
this.bodyA = this.world.createBody(shape, #dynamic, 1, 1, 1, 50, 20);
this.bodyB = this.world.createBody(shape, #dynamic, 1, 1, 1, 50, 20);
var def =
{
dampingRatio: 0.5; //from 0 to 1
};
var (xa, ya) = this.bodyA.getWorldCenter();
var (xb, yb) = this.bodyB.getWorldCenter();
this.joint = this.world.createDistanceJoint(this.bodyA, this.bodyB, xa, ya, xb, yb, def);