From c4e73ec8a74600e568233bcedef215fc27db0144 Mon Sep 17 00:00:00 2001 From: Xuchen Han Date: Mon, 18 Nov 2019 14:47:57 -0800 Subject: [PATCH] Add faces to volumetric objects in deformable demos --- examples/DeformableDemo/Pinch.cpp | 1 + examples/DeformableDemo/VolumetricDeformable.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/DeformableDemo/Pinch.cpp b/examples/DeformableDemo/Pinch.cpp index 7c966cc4d..ed811a417 100644 --- a/examples/DeformableDemo/Pinch.cpp +++ b/examples/DeformableDemo/Pinch.cpp @@ -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); diff --git a/examples/DeformableDemo/VolumetricDeformable.cpp b/examples/DeformableDemo/VolumetricDeformable.cpp index 7eaf9aa37..1f23071d4 100644 --- a/examples/DeformableDemo/VolumetricDeformable.cpp +++ b/examples/DeformableDemo/VolumetricDeformable.cpp @@ -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);