Soft body /Gish challenge [Theory]

How do you make distance joints soft? and would they be faster to use than this code, which is basically just applied to 16 objects + a center object?

I couldn't find it in the manual anywhere.
In a post somewhere on the forum, Erin states that 2.0.1 has a soft distance joint. I couldnt find this.

In a different post Boris notified me of his controller pack which features a spring.

Code: Select all

http://boristhebrave.com/project/controller-grab-pack
Thanks for the tip.

I tried the boris spring controller and it is pretty much identical to the distant joint now in 2.x

When you initialise a new joint, you can access the JointDef.frequencyHz and damping parameters and this is what they mean by spring joint: if you don't meddle with those optional fields, you get a rigid (critical) joint, but when you do meddle with those, you get a spring joint.

I think the boris controllers came out a little before.

I was doing my gish ball using boris' controller however I broke it under extreme conditions when playing, so I switched to just distance joints, which is quite stable, and you get a good simulation from it. I did meddle with frequency, and it gives a better effect, but can still explode if you're not careful.
Ahh so thats what frequency is for on a distance joint. Thanks for explaining that.
Yep although its a bit odd to use numerically, I think you need higher values to get less damping or something with 0 being no damping. Can't remember, you'll need to search forums, but it isn't intuitive 🙂
I'm trying to create a blob in Flash, exactly like in the demo, and wondered if anyone had ported the ConstantVolumeJoint code to AS3? I presume it requires that and the demo is not made with any of the standard joints in Box2D?
I've made reasonably good progress porting the Constant Volume Joint to AS3 but its not working yet.

Looks like it uses a few methods and constants that are in the Java version only - I need to download Java Box2D and investigate...

So far I've converted b2ConstantVolumeJoint and b2ConstantVolumeJointDef. I also made one change to b2Joint, adding a new constant for the joint and a constructor. My test bed can create bodies and use the joint, but the behaviour is wrong so far.

Rob
Cool, when you have got that fully ported, I'd love to put it in the AS3 version, if you are willing, assuming Java's licence is the same.
if there is a link to the java example that shows this in action i would be thrilled to see it!
sketchbookgames wrote:if there is a link to the java example that shows this in action i would be thrilled to see it!


http://jbox2d.org/blob/

Several examples, hit right arrow to move through them

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