Hello, i already posted on the box2d forum and maybe you have an idea. Here is the situation :
In the image there is a b2DistanceJoint (the blue line) and a b2MouseJoint dragging the black smiling ball.
The joint (blue line) is created as follows:
jointDef.Initialize( bodyA, bodyB, bodyA->GetWorldCenter(), bodyB->GetWorldCenter() );
jointDef.length = 1.2;
jointDef.dampingRatio = 0.5;
jointDef.frequencyHz = 0.9;
jointDef.collideConnected = false;
grumoJoint = (b2DistanceJoint*)world->CreateJoint(&jointDef);
It is springy and has the length of 1.2. But when i’m dragging with a b2MouseJoint the black ball, there is no length limit on the b2DistanceJoint! The blue line can go where I drag the ball. How to limit the distance that the ball can be dragged?
Is there an additional joint i can add so to limit tha distance to where i can drag the ball in all directions?