Dynamic shape but same surface size

heres my squishy blob. I hasnt got all those fancy physics calculations ewjordan speaks about 😉 but its fun to watch 😀 (arrowkeys for motion)
Okay, I finally got a working demo in Java (testing a few different settings if you hit right): http://www.jbox2d.org/blob

I'm not sure how ultimately useful this would be as-is, since it behaves a little oddly for some settings, and there still might be a couple bugs with position correction and/or warm-starting. But in any case, it's in the JBox2d SVN repo now (extra joints are a very non-invasive edit to the engine, so I'm fine with leaving it there just in case it's useful to someone). It's not very flexible at the moment, as it merely works based on the center of mass of the body, but I'm going to see about getting this working for chains of rectangles instead of just circles, and then maybe I'll think about porting it to C++.
Cool and good looking ideas !! And fast.

- ewjordan, you did it - if i understood correctly - via a joints concept -ConstantVolumeJoint, and adding bodies via this class ?
- zappBrannigan, how did you do the blob ?

Maybe its time to think about a concept, how to handle connected multiple b2Bodies in box2d ?


regards - nimodo
nimodo wrote:
- ewjordan, you did it - if i understood correctly - via a joints concept -ConstantVolumeJoint, and adding bodies via this class ?

Right, it's just a normal joint, and you add bodies to the def before you create the joint. The only reason this doesn't fit in so well is that the b2Joint interface assumes that each joint connects two bodies, not N bodies, so general N body joints won't do things like island formation correctly. In this case it sort of works out because the joint creates distance joints connecting all the involved bodies anyways, but it's definitely not the ideal situation, because for instance implicit joint destruction when an involved body is destroyed doesn't happen correctly. Maybe it would be worth figuring out a better solution...
ewjordan, your first example seems pretty close to what I wanted: http://www.ewjordan.com/processing/VolumeBlob/

I will try to see if I can make it behave as I expected (no bouncing, no gravity etc)

thanks, chr
ewjordan, well, if I decrease the forces to reform the shape (relaxFactor) the shape basically breaks.

Thanks, chr

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