The desired effect: When my soft body falls onto a cube and I click a button to harden, the soft body should become stiff and retain the imprint from the cube (it should not expand back to its original shape).
I found one solution that works for making the soft body harder, but I can't go back to making it soft again:
Code: Select all
btSoftBody::Material* material = softBody->appendMaterial();
softBody->generateBendingConstraints(10,material);
softBody->m_cfg.piterations = 20;
Is there another parameter i can use to control the soft body stiffness? I've tried m_cfg.kCHR, m_cfg.kKHR, m_cfg.kSRHR_CL, m_cfg.kSKHR_CL, m_cfg.kSSHR_CL, m_cfg.kVC, m_cfg.kPR. None of them make much difference.
Here is the code I am using to generate the soft body:
Code: Select all
btSoftBody* softBody = btSoftBodyHelpers::CreateFromTriMesh(worldInfo,vertices,this->attachedMesh->getElements(),numTriangles);
btSoftBody::Material* material = softBody->appendMaterial();
softBody->generateBendingConstraints(2,material);
softBody->m_cfg.piterations = 4;
softBody->m_cfg.kDF = .5;
softBody->m_cfg.collisions |= btSoftBody::fCollision::VF_SS;
softBody->randomizeConstraints();
softBody->setTotalMass(mass,true);