clean up reduced body creation

This commit is contained in:
jingyuc
2021-09-12 23:21:20 -04:00
parent b4efd91476
commit 1c8afcf54f
9 changed files with 50 additions and 92 deletions

View File

@@ -119,12 +119,7 @@ void ModeVisualizer::initPhysics()
// create volumetric soft body
{
std::string filepath("../../../examples/SoftDemo/beam/");
std::string filename = filepath + "mesh.vtk";
btReducedSoftBody* rsb = btReducedSoftBodyHelpers::createFromVtkFile(getDeformableDynamicsWorld()->getWorldInfo(), filename.c_str());
rsb->setReducedModes(start_mode, num_modes, rsb->m_nodes.size());
btReducedSoftBodyHelpers::readReducedDeformableInfoFromFiles(rsb, filepath.c_str());
btReducedSoftBody* rsb = btReducedSoftBodyHelpers::createReducedBeam(getDeformableDynamicsWorld()->getWorldInfo(), start_mode, num_modes);
getDeformableDynamicsWorld()->addSoftBody(rsb);
rsb->getCollisionShape()->setMargin(0.1);