Instability during collision between two softbodies

Post Reply
pskishor
Posts: 8
Joined: Fri Aug 01, 2008 7:43 am

Instability during collision between two softbodies

Post by pskishor »

why there is unstable when collision between two softbodies
(one a rope using CreateRope() and cloth using CreatePatch()).

Are there other parameters for controlling so that I can make it stable.


/// code
static void Init_ClusterCollide1(SoftDemo* pdemo)
{
const btScalar s=8;
btSoftBody* psb=btSoftBodyHelpers::CreatePatch( pdemo->m_softBodyWorldInfo,btVector3(-s,1,-s),
btVector3(+s,1,-s),
btVector3(-s,1,+s),
btVector3(+s,1,+s),
31,31,
1+2+4+8,true);
btSoftBody::Material* pm=psb->appendMaterial();
pm->m_kLST = 0.4;
pm->m_flags -= btSoftBody::fMaterial::DebugDraw;
psb->m_cfg.kDF = 1;
psb->m_cfg.kSRHR_CL = 1;
psb->m_cfg.kSR_SPLT_CL = 0;
psb->m_cfg.collisions = btSoftBody::fCollision::CL_SS+
btSoftBody::fCollision::CL_RS+
btSoftBody::fCollision::VF_SS;
psb->generateBendingConstraints(2,pm);
psb->setTotalMass(50);
psb->generateClusters(64);
pdemo->getSoftDynamicsWorld()->addSoftBody(psb);

Ctor_RbUpStack(pdemo,10);

{const int n=2;
for(int i=0;i<n;++i)
{
btSoftBody* psb=btSoftBodyHelpers::CreateRope(pdemo->m_softBodyWorldInfo, btVector3(-10,0,i*0.25),
btVector3(10,0,i*0.25),
16,
1+2);
psb->m_cfg.piterations = 4;
psb->m_materials[0]->m_kLST = 0.1+(i/(btScalar)(n-1))*0.9;
psb->setTotalMass(20);
//psb->m_cfg.kDF = 1;
psb->m_cfg.kSRHR_CL = 1;
//pm->m_kLST = 0.1;
//pm->m_flags -= btSoftBody::fMaterial::DebugDraw;
psb->m_cfg.kSR_SPLT_CL = 0;
psb->generateClusters(64);
psb->m_cfg.collisions |= btSoftBody::fCollision::VF_SS;
//btSoftBody::fCollision::VF_SS+
// btSoftBody::fCollision::CL_RS;
pdemo->getSoftDynamicsWorld()->addSoftBody(psb);

}
}
}
Nathanael
Posts: 78
Joined: Mon Nov 13, 2006 1:44 am

Re: Instability during collision between two softbodies

Post by Nathanael »

You cannot use cluster collision on 1d soft bodies, for best results, try to model volumetric ropes with soft bodies, or better still, rigid bodies connected by constraints.

Don't forget that currently, collision detection is discreet, so thinner your shape is, more likely it is to miss collisions, and you can't make much thinner than a 1d rope.

Hope it help,
Nathanael.
pskishor
Posts: 8
Joined: Fri Aug 01, 2008 7:43 am

Re: Instability during collision between two softbodies

Post by pskishor »

Hello Nathanael,

Thanks for your previous suggestion.

First, I made one dimensional rope and got same result as u told, it missed collision.
Then I made rope using rigidbodies(cylinders) joined by constraints,
but still result was unsatisfied, it often missed collsion,
couldn't tie other fixed rigidboy by that rope.

Now I want to make volumetric rope with softbodies.
Would u suggest me how to model softbody volumetric rope,
and how to handle while tension apply to rope or to tie fixed rigidbody by rope.

With regards
pskishor
Post Reply