softbody teared apart

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

softbody teared apart

Post by mickey »

Hi

My softbodies are created from the btSoftBodyHelpers::CreateFromTriMesh function, but whenever it lands on the ground its torn apart to pieces / flattened.

Perhaps the flags/settings I used are not correct? I use a mix of settings from the Init_Volumne sample and Init_Collide.

I removed the generateBendingConstraints and randomizeConstraints, as well as the generateClusters as it causes unstable performance (slowness, or halt) to the app.

Here's the complete init code:

Code: Select all

btSoftBody*	psb= btSoftBodyHelpers::CreateFromTriMesh( m_softBodyWorldInfo, m_pTreeTriMeshData->vertices, m_pTreeTriMeshData->indices, m_pTreeMesh->GetStaticMesh()->GetNumFaces() );
		btSoftBody::Material*	pm=psb->appendMaterial();
		pm->m_kLST	= 0.5f;
		pm->m_kVST = 0.5f;
		pm->m_kAST = 0.5f;
		//psb->generateBendingConstraints(1,pm);		
		psb->m_cfg.piterations	=	2;
		psb->m_cfg.kDF			=	0.5;
		psb->m_cfg.collisions|=btSoftBody::fCollision::VF_SS;
		//psb->m_cfg.kVC				=	20;
		//psb->randomizeConstraints();		
		psb->scale( btVector3(15.f,15.f, 15.f));
		psb->translate(btVector3(-10,10,-10));		
		psb->setTotalMass(10);
		psb->setPose(true,false);		
		//psb->generateClusters(4);	
Any clues? Many thanks.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: softbody teared apart

Post by Erwin Coumans »

If you want to use BulletSoftBody, the only advice is: check the Bullet/SoftBody demos again. And again.

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

Re: softbody teared apart

Post by mickey »

Haha okay. I absolutely want to use Bullet softbodies. I'll go try another round again.

Thanks.