Are collisions between Tetra btSoftbodies possible?

Adler
Posts: 5
Joined: Mon Feb 01, 2010 8:27 pm

Are collisions between Tetra btSoftbodies possible?

Post by Adler »

I my Scene I use static Objects (btCollisionObject) and btSoftbodys
The Softbodies could be Triangle Meshes but also Tetrahedron Meshes.

Collision Reaction between these Objects is fine, but between Tetrahedon Meshes
no collision reaction occures. A Tetrahedron Softbody will just pass another Tetrahedon
Softbody but will collide with the btCollisionObject or a Tri-Softbody.

In the Softbody Demo Tetrahedron Meshes are also used with one TetMesh, thus
i am not sure if bullet may handle this.

Is this not possible with Bullet or did i something wrong?

BTW: Is there some information what the Cluster Collision means and what i have
to keep in mind if i will use CF_SS / CF_RS and not VF_SS?

Code: Select all

btSoftRigidDynamicsWorld * sworld = [ get world ]
btSoftBody * psb = createMesh(filename);              // will create Mesh similar to btSoftbodyHelpers as Triangle or TetraMesh 

btSoftBody::Material*	pm=psb->appendMaterial();
pm->m_kLST				=	0.05;
pm->m_flags				-=	btSoftBody::fMaterial::DebugDraw;
psb->generateBendingConstraints(2,pm);
psb->m_cfg.piterations	=	2;
psb->m_cfg.citerations	=	2;
psb->m_cfg.kDF			=	0.5;
//psb->m_cfg.kDF			=	10;
psb->m_cfg.collisions	|=	btSoftBody::fCollision::VF_SS;
//     Cluster will not collide with Ground, but maybe this is my fault...
//	psb->m_cfg.collisions = btSoftBody::fCollision::CL_SS+	btSoftBody::fCollision::CL_RS;
psb->randomizeConstraints();
psb->generateClusters(1);
	
if ( isTriMesh(m)) psb->setTotalMass(100,true);
if (isTetMesh(m))	psb->setVolumeMass(100);

sworld->addBody(psb);
Xcoder79
Posts: 42
Joined: Sun Aug 07, 2011 5:27 am

Re: Are collisions between Tetra btSoftbodies possible?

Post by Xcoder79 »

Try setting GenerateClusters to a higher value other then 1
Adler
Posts: 5
Joined: Mon Feb 01, 2010 8:27 pm

Re: Are collisions between Tetra btSoftbodies possible?

Post by Adler »

I changed the generate Clusters settings to an higher value - tried 64, 100, 9000.
The behavior changed. I think the meshes collided but they also exploded.
In a Demo i read, that i can set generateClusters to 0 which results in a cluster for
each primitive (Tetra or Tri)

THIS results in a stable behavior but i do not realy understand why. Maybe it depends
on the Properties of my Tetramesh.

For the experiment i create a Tetra-Shell for Triangular Surfaces where 3 Tetraeders are
generated for every Tri. This also means that i got small dihedral angles for thinn
shell shapes which maybe bad.
On the other hand - i dont understand why the mesh explodes with 250 Clusters or even more
and is stable with 0. My Tetramesh has at max 240 Tetras

I hat these solutions where it works but nobody knows why