if( length > restlength ){ move particles closer togeather} else if( length < restlength ){ do nothing, as ropes can be coiled}
But this doesnt seem to work. The contacts seem to be gradually getting longer, allowing the particles to move further and further apart. Its happening quite slowly, but its noticeable.
I assume this is due to contending particles?
CurrentPose DesiredPose X Particle A X Particle A | | | | | | | X Particle B | | | | X Particle B | | X Particle C | | | | | X Particle C
Where on the left the segments are too long and need to be corrected. Particle A is fixed in space, and so nothing is changed on A, so correcting the first segment, causes B to move closer to A, doing so by changing B's impulse. But then correcting the second segment, by changing B and C's impulse to move closer togeather, then voids B's impulse that was corrected by the first segment. And this will happen all the way down the chain.
Is this what is causing the problem? How could this be solved? Should I treat the first particle in each segment fixed, and only alter the other ends impulse?