Petal simulation
Posted: Fri Apr 12, 2019 12:50 pm
Hi, I'm new to Bullet physics. I'm working on plant modeling and I want to use Bullet physics to simulate petal material and handle the collisions between petals of different flowers. In my program petals are represented by triangle faces and they have no volume just like cloth and paper, but I want them to be harder than cloth and be able to keep their overall shape in a small collision.
Here are what I have done to do this(simulate petals with btSoftBody), the problem is that petals turn out to be too soft. I want them to be harder.
But I really have no idea which attribute of btSoftBody and btSoftBody::Material I should adjust to do this.
I copied these parameters from Bullet SoftBody Demo, how to adjust them to make soft body harder(stronger shape preserve ability)?
thanks!
Here are what I have done to do this(simulate petals with btSoftBody), the problem is that petals turn out to be too soft. I want them to be harder.
But I really have no idea which attribute of btSoftBody and btSoftBody::Material I should adjust to do this.
Code: Select all
pSoftBody=btSoftBodyHelpers::CreateFromTriMesh(*worldInfo,pVertices,pTriangles,triangleNum);
btSoftBody::Material *pMat=pSoftBody->appendMaterial();
pMat->m_kLST = 0.5;
pMat->m_kAST=1.0;
pMat->m_kVST=1.0;
pSoftBody->generateBendingConstraints(2,pMat);
pSoftBody->m_cfg.kDF=0.5;
pSoftBody->m_cfg.piterations=2;
pSoftBody->m_cfg.kDP = 0.005;
pSoftBody->m_cfg.kCHR = 0.1;
pSoftBody->setTotalMass(10);
pSoftBody->setMass(rootIndex,0);//set static nodes
pSoftBody->setMass(farIndex,0);
thanks!