Washing line physics?

Hi there,

I want to create an application that represents the physics of a washing line.

Image

I'm creating simple polygon defs/bodies and use setAsBox() to define a "rectangular"
area. Now I need to connect these rectangles to a line. Than I want to be able to
move the washing line from left to right. Does someone knows what joints I need
to use? Or do I need to use something else than joints?

Roxlu
Cloths are not really rigid bodies. But you might want to look at the elastic body testbed example.

If you go for an alley cat remake... YAY! 😉
Hi Daid...

Haha okay I think I need to clear up my original post as I do not want clothes physics 😉.
It's more a line with solid object (like christmass cards), though I couldnt find an image
of christmass cards on a line.

So NO CLOTHES physics. But more the physics of the 'lines' and the things that hang
under the line. The "things" will be chrismass cards. Like this image:
Image

Though I connect the cards with the big "wire" with smaller wires. The 'main' wire
where all cards are connected with will be moving. I want to cards to move into
the same direction as they are 'pulled' by the main wire.

Is this a bit more clear?

Roxlu
Yes. Sounds like you need a lot of distance joints.

If you make an invisible "track" like tank tracks, then you should be able to achieve this effect. There should be a few examples of tracks/belts. Then put the and start point off screen so you can attach and deattach the cards there.
Have a look at the bridge example in the Testbed.
Hi Boris!


Thanks again!

Do you maybe also know if I can create, lets say 100 boxes on a wire?
Or will this be a penalty on the performance?

Roxlu
The C++ version already sports a chain which is pretty fine. I should imagine 100 bodies should be ok, but the best way to find out it to test it. But I'm not sure what you want that for. Two links between each sock on your washing line should be sufficient, and one acceptable.

Note Box2D will have problems if you try to suspend heavy items on a light wire. So you may need fiddle with mass ratios.

Original thread: https://box2d.org/forum/viewtopic.php?t=1854