I make a small JavaScript game using Box2D (although I think the language is not important, since the engine is the same, as far as is known, and was exported to JavaScript ).
I connect several bodies with the help of Distance Joint . When creating a joint, I specify frequencyHz = 11 and dampingRatio = 0 (as I understood, the less dampingRatio , the faster the element returns to its original position, that is, the spring will be harder, which is what I need). I apply force to each body:
body.ApplyForce(new b2Vec2(0, 5800), body.GetWorldCenter()) I need this in order for these bodies to have more gravity than others.
After creating several elements, they all start to twitch, vibrate, as if something is bothering them, stop and lock themselves in some position.
I tried to "play" with the parameters of the frequencyHz and dampingRatio on the joint , and ensured that the construction did not twitch, but then the construction seemed less rigid and smoother.
Is there any solution?
I think that the design vibrates due to the fact that the weight of several elements, and the force applied to them, pulls the object down, increasing the length of the joint, while this joint is trying to squeeze back to its original position, because of this, vibration is produced, as the element quickly moves to different sides