This project has moved. For the latest updates, please go here.

Non fixed polygon

Mar 12, 2009 at 6:14 PM
I have a List of bodies which are all moving around on the screen.  How do I create a polygon Geom which rather than having fixed points will use a list of points which I may change based on the position of those bodies?

Mar 12, 2009 at 11:37 PM
Thats kinda tough because you can't alter the position of vertices in a body after its been created. I think i know what you're trying to make though; Soft bodies, right?
Mar 13, 2009 at 9:55 AM
Yes, that's exactly what I am doing.  I want a very pliable shape but I simply don't want points to pass each other.  This means that I can't really greate the geometries until the positions of the bodies have been updated.

My shape is a circle made up of 20 points (each point being a body), in the centre of that shape there is another single body to act as the center of gravity.  I am currently experiencing two problems.

1: The outer bodies are able to pass each other, this results in my shape becoming too liquid like.
2: I can't think how I am going to cause rotation.

Mar 13, 2009 at 8:12 PM
Ok this is kinda gonna be hard. you need one geom for each "point" maybe in a small circle or something, and then geometries to connect these together (so you have a chain). Then you need springs to attach all of these bodies together, and maybe a connection to the center body (so that it is all manipulated with a reasonable degree of ease). However; i haven't actually done such a thing myself, and i hear that it is a *major* drag (pun inended) on the engine. However; if you want soft body physics, you should go with walaber's JelloPhysics engine. It has a (limited) capability to support rigid (static) bodies and its a little (ok a lot) less polished, but its main forte is squishy, soft stuff.