I'm in trouble with SoftBody
I'm trying to modeling a rope starting from a mesh (please, see the attachment RopeMesh.h). This is a cylinder of 10m, with 32 resolution faces and 8 subdivisions on the length. Then, I'm using this code in order to build the SoftBody:
Code: Select all
static void Init_RopeMatch(SoftDemo* pdemo)
{
btSoftBody* psb = btSoftBodyHelpers::CreateFromTriMesh(pdemo->m_softBodyWorldInfo, gVerticesRope,
&gIndicesRope[0][0],
ROPE_NUM_TRIANGLES);
psb->m_materials[0]->m_kLST = 0.0; //Linear stiffness coefficient [0,1]
psb->m_materials[0]->m_kAST = 0; //Area/Angular stiffness coefficient [0,1]
psb->m_materials[0]->m_kVST = 0; //Volume stiffness coefficient [0,1]
psb->m_cfg.kMT = 0.5;
psb->m_cfg.piterations = 5;
psb->randomizeConstraints();
psb->scale(btVector3(6, 6, 6));
psb->setTotalMass(1, true);
psb->setMass(0, 0);
psb->setMass(psb->m_nodes.size()-1, 0);
psb->setPose(false, true);
pdemo->getSoftDynamicsWorld()->addSoftBody(psb);
}
Basically, I can see the cylinder that is anchored on the first and last node, but the cylinder is pretty rigid, do not bend freely on the 8 subdivisions. It's like a "high jump pole".
Using the btSoftBodyHelpers::CreateRope the rope behavior is very good but I need to start from my mesh (the btSoftBodyHelpers::CreateRope is just a line without volume and in any case I need an integration with meshes).
Setting material stiffness coefficients to 0 doesen't help. How I can setup the SoftBody in order to make the cylinder mesh like a falling rope under gravity? Maybe I need to build a different mesh?
Basically, in a rope I don't need to make soft the "circular section" (the cylinder volume do not change) but I need to bend the subdivisions....I don't know if it's possible...
Many thanks,
bye