I'm trying to make a grapple with a string of circles connected with distance joints or revolute joints (cant get either to work). In either case it stretches rather than swinging the mass at the loose end.
Is it expected that distance joints dont hold the length (not even close) and that revolute joints dont lock the two anchor points together? I'm not sure if this is a bug or a limitation.
Box2D uses an iterative solver that performs poorly when light bodies are supporting heavy bodies. So normally a mass ratio greater than 10:1 will lead to some stretching. You can improve the situation by using a smaller time step and/or more solver iterations.
I have been watching the same problem in other phys engines, such as havok. More iterations can do it, but it is very slow. I came with a simple (yet not perfect) solution, I joined first and last of the chain bodies with maximum distance joint, so they never get farther as the chain's length should be
Thanks Pangamini, I'll try that out to see if it helps my scenario.
Erin, I see you had a post on gphysics about position correction for revolute joints (in november). I'm currious which algorithm(s) you settled on, and if you think Full NGS would help here.
-Brandon
Box2D is using a full NGS and block solver for revolute joints. It solves a single joint very well, but it still solves joint by joint. To get an exact solution for a system of revolute joints you'll have to form a large matrix to encompass all the joints simultaneously. This requires order n*n memory and requires order n*n*n time to factor. This is usually too expensive for games that have to run in real-time. So we sacrifice because we can control the model (and the mass ratios it uses).