mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-09-06 10:28:40 +00:00
created new free fall example. WIP
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user