created new free fall example. WIP

This commit is contained in:
jyc-n
2021-08-09 16:26:17 -04:00
parent 042a1f75c9
commit 3425c01acc
8 changed files with 326 additions and 20 deletions

View File

@@ -169,7 +169,7 @@ void BasicTest::initPhysics()
m_dynamicsWorld->setGravity(gravity);
m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld);
// create volumetric soft body
// create volumetric reduced deformable body
{
std::string filepath("../../../examples/SoftDemo/");
std::string filename = filepath + "mesh.vtk";
@@ -180,11 +180,17 @@ void BasicTest::initPhysics()
getDeformableDynamicsWorld()->addSoftBody(rsb);
rsb->getCollisionShape()->setMargin(0.1);
// rsb->scale(btVector3(1, 1, 1));
rsb->translate(btVector3(0, 4, 0)); //TODO: add back translate and scale
// rsb->scale(btVector3(1, 1, 1)); //TODO: add back scale
rsb->translate(btVector3(0, 4, 0));
// rsb->setTotalMass(0.5);
rsb->setStiffnessScale(0.5);
rsb->setFixedNodes();
// set fixed nodes
rsb->setFixedNodes(0);
rsb->setFixedNodes(1);
rsb->setFixedNodes(2);
rsb->setFixedNodes(3);
rsb->m_cfg.kKHR = 1; // collision hardness with kinematic objects
rsb->m_cfg.kCHR = 1; // collision hardness with rigid body
rsb->m_cfg.kDF = 0;