Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm using box2d and I simply hook up 10 points each with a similar length constraint to the adjacent point.

When I move 1 point, the others follow just like a rope/chain. Just like one would expect.

What I would not expect however is that when I fix the leftmost point and then pull the right most, the points distribute themselves very odd. When I simulate it using ascii it is as following:

OO-O--O---O----O-----O------O-------O--------O

I would have prefered that one point would 'win' (given the order of point creation or something) and that the rest of the points would never reach the other point (due to their constraints). Or maybe even that the points would distribute themselves in a better fashion.

Does anyone have an explanation on why this is and how this might be solved?

share|improve this question

1 Answer 1

(Just to be clear, when you say "length constraint", you mean b2DistanceJoint right?)

Is this along the ground? If so, pulling on the rightmost one is going to have to fight both the length constraint and the friction of all the others on the ground.

Are you sure your points are all equidistant from their neighbors when you first link them?

share|improve this answer
    
wreschnig: Indeed I use b2distancejoint. And all initial distances are exactly what they should be. Furthermore there is no ground (at least not in the screen anywhere) so that doesn't interfere. You see the same effect when applying gravity. If you fix 1 point of the rope to the mouse, and the rest is dragged down by gravity, if the gravity is sufficiently high, the rope get's pulled down in the same unequidistant manner. –  Toad Nov 13 '10 at 20:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.