From 41ca8b9e59f1b5d6f7e7a4cd62de92bae1d1e587 Mon Sep 17 00:00:00 2001 From: Xuchen Han Date: Fri, 6 Mar 2020 16:29:32 -0800 Subject: [PATCH] More parameter tuning for cloth-like behavior --- examples/DeformableDemo/DeformableSelfCollision.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/DeformableDemo/DeformableSelfCollision.cpp b/examples/DeformableDemo/DeformableSelfCollision.cpp index 7b8fd9c3a..a5999084c 100644 --- a/examples/DeformableDemo/DeformableSelfCollision.cpp +++ b/examples/DeformableDemo/DeformableSelfCollision.cpp @@ -155,8 +155,7 @@ void DeformableSelfCollision::addCloth(btVector3 origin) psb->getCollisionShape()->setMargin(0.0075); - psb->generateBendingConstraints(2); - psb->generateBendingConstraints(2); + psb->generateBendingConstraints(3); psb->setTotalMass(.5); psb->m_cfg.kKHR = 1; // collision hardness with kinematic objects psb->m_cfg.kCHR = 1; // collision hardness with rigid body @@ -171,8 +170,8 @@ void DeformableSelfCollision::addCloth(btVector3 origin) getDeformableDynamicsWorld()->addSoftBody(psb); psb->setSelfCollision(true); - btDeformableMassSpringForce* mass_spring = new btDeformableMassSpringForce(3,0.2, true); - psb->setSpringStiffness(3); + btDeformableMassSpringForce* mass_spring = new btDeformableMassSpringForce(1.5,0.1, true); + psb->setSpringStiffness(1); getDeformableDynamicsWorld()->addForce(psb, mass_spring); m_forces.push_back(mass_spring); btVector3 gravity = btVector3(0, -9.8, 0);