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);