softbodies on static shapes crashes/unstable

mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

softbodies on static shapes crashes/unstable

Post by mickey »

Hi

I have a complex 3D scene using btvTriangleMeshShape and whenever a soft body (my sample uses the btSoftBodyHelpers::CreatePatch and btSoftBodyHelpers::CreateEllipsoid) collides with the scene a crash occurs on these lines:

Code: Select all

if (shapeCache[partId][triangleIndex])
{
		btCollisionShape* tm = shapeCache[partId][triangleIndex];

		//copy over user pointers to temporary shape
		tm->setUserPointer(ob->getRootCollisionShape()->getUserPointer());

		...
}
in btSoftBodyConcaveCollisionAlgorithm line 131 to be exact.

Also, when I use btStaticPlaneShape after a few collisions with rigid bodies the soft body would fall through the ground? (perhaps collision margin problem?)

I wonder if this is still a work in progress?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: softbodies on static shapes crashes/unstable

Post by Erwin Coumans »

It looks like you are using an older version of Bullet.

Can you try the very latest one from http://code.google.com/p/bullet/downloads/list
Thanks,
Erwin
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: softbodies on static shapes crashes/unstable

Post by mickey »

thanks. it solved the run-time error.

Unfortunately, the soft body still suffers from 2 things:

1. when it touches the concave shape, my fps drops to 1.
2. after a few frames upon touching ground, the soft body just goes through.

These 2 behaviors can be replicated on the soft body demo specifically #2. Set the useConcaveMesh to true on line 1607.

Perhaps the collision between concave shape and soft body is still a work in progress? I saw this comment:

bool useConcaveMesh = false; //not ready yet true;

And when I did set it to true, I wait for the ellipsoid to drop to the ground and shoot it multiple times (5 - 10) and after a few roll overs it will fall through the concave mesh.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: softbodies on static shapes crashes/unstable

Post by Erwin Coumans »

It is better to enable cluster collision when using soft bodies.

This should improve performance and improve collision quality.

Hope this helps,
Erwin
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: softbodies on static shapes crashes/unstable

Post by mickey »

Hi Erwin

Copying the cluster code from the demo improved the performance.

But there still the problem where the soft body would just go through the ground / static shapes after a few collision.

This behavior can be replicated in the bullet soft body demo - InitVolume()

Hit the ellipsoid multiple times and after a while it will fall through the ground. Here's a screen shot:

Image

Thanks.