Add faces to volumetric objects in deformable demos

This commit is contained in:
Xuchen Han 2019-11-18 14:47:57 -08:00
parent e5ed15c3b2
commit f5400b40d2
2 changed files with 2 additions and 0 deletions

View File

@ -314,6 +314,7 @@ void Pinch::initPhysics()
psb->m_cfg.kDF = 2;
psb->m_cfg.collisions = btSoftBody::fCollision::SDF_RD;
getDeformableDynamicsWorld()->addSoftBody(psb);
btSoftBodyHelpers::generateBoundaryFaces(psb);
btDeformableMassSpringForce* mass_spring = new btDeformableMassSpringForce(1,0.05);
getDeformableDynamicsWorld()->addForce(psb, mass_spring);

View File

@ -220,6 +220,7 @@ void VolumetricDeformable::initPhysics()
psb->m_cfg.kCHR = 1; // collision hardness with rigid body
psb->m_cfg.kDF = 0.5;
psb->m_cfg.collisions = btSoftBody::fCollision::SDF_RD;
btSoftBodyHelpers::generateBoundaryFaces(psb);
btDeformableGravityForce* gravity_force = new btDeformableGravityForce(gravity);
getDeformableDynamicsWorld()->addForce(psb, gravity_force);