diff --git a/examples/DeformableDemo/ClothFriction.cpp b/examples/DeformableDemo/ClothFriction.cpp index ef9c8da47..e62dab0d2 100644 --- a/examples/DeformableDemo/ClothFriction.cpp +++ b/examples/DeformableDemo/ClothFriction.cpp @@ -104,6 +104,8 @@ void ClothFriction::initPhysics() btVector3 gravity = btVector3(0, -10, 0); m_dynamicsWorld->setGravity(gravity); getDeformableDynamicsWorld()->getWorldInfo().m_gravity = gravity; + getDeformableDynamicsWorld()->getWorldInfo().m_sparsesdf.setDefaultVoxelsz(0.25); + getDeformableDynamicsWorld()->getWorldInfo().m_sparsesdf.Reset(); m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld); diff --git a/examples/DeformableDemo/DeformableSelfCollision.cpp b/examples/DeformableDemo/DeformableSelfCollision.cpp index cb4f405c2..6b1d92611 100644 --- a/examples/DeformableDemo/DeformableSelfCollision.cpp +++ b/examples/DeformableDemo/DeformableSelfCollision.cpp @@ -166,6 +166,7 @@ void DeformableSelfCollision::initPhysics() psb->m_cfg.collisions = btSoftBody::fCollision::SDF_RD; psb->m_cfg.collisions |= btSoftBody::fCollision::VF_DD; getDeformableDynamicsWorld()->addSoftBody(psb); + psb->setSelfCollision(true); btDeformableMassSpringForce* mass_spring = new btDeformableMassSpringForce(10,0.2, true); getDeformableDynamicsWorld()->addForce(psb, mass_spring); diff --git a/src/BulletSoftBody/btSoftBody.cpp b/src/BulletSoftBody/btSoftBody.cpp index c46f7a3b8..e4e8c0c41 100644 --- a/src/BulletSoftBody/btSoftBody.cpp +++ b/src/BulletSoftBody/btSoftBody.cpp @@ -119,6 +119,7 @@ void btSoftBody::initDefaults() m_dampingCoefficient = 1; m_sleepingThreshold = 0.1; m_useFaceContact = false; + m_useSelfCollision = false; m_collisionFlags = 0; }