diff --git a/examples/DeformableDemo/DeformableMultibody.cpp b/examples/DeformableDemo/DeformableMultibody.cpp index 7b9137cc9..40db119b9 100644 --- a/examples/DeformableDemo/DeformableMultibody.cpp +++ b/examples/DeformableDemo/DeformableMultibody.cpp @@ -113,6 +113,8 @@ void DeformableMultibody::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/DeformableRigid.cpp b/examples/DeformableDemo/DeformableRigid.cpp index 748f1f4c8..9a3ca9403 100644 --- a/examples/DeformableDemo/DeformableRigid.cpp +++ b/examples/DeformableDemo/DeformableRigid.cpp @@ -154,6 +154,8 @@ void DeformableRigid::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(); // getDeformableDynamicsWorld()->before_solver_callbacks.push_back(dynamics); m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld); diff --git a/examples/DeformableDemo/PinchFriction.cpp b/examples/DeformableDemo/PinchFriction.cpp index 1cbc7e43d..bf0d57d0b 100644 --- a/examples/DeformableDemo/PinchFriction.cpp +++ b/examples/DeformableDemo/PinchFriction.cpp @@ -112,9 +112,9 @@ void dynamics2(btScalar time, btDeformableMultiBodyDynamicsWorld* world) if (rbs.size()<2) return; btRigidBody* rb0 = rbs[0]; - btScalar pressTime = 0.9; - btScalar liftTime = 10; - btScalar shiftTime = 3.5; + btScalar pressTime = 0.45; + btScalar liftTime = 5; + btScalar shiftTime = 1.75; btScalar holdTime = 4.5*1000; btScalar dropTime = 5.3*1000; btTransform rbTransform; @@ -124,9 +124,9 @@ void dynamics2(btScalar time, btDeformableMultiBodyDynamicsWorld* world) btVector3 initialTranslationLeft = btVector3(0.5,3,4); btVector3 initialTranslationRight = btVector3(0.5,3,-4); - btVector3 PinchFrictionVelocityLeft = btVector3(0,0,-1); - btVector3 PinchFrictionVelocityRight = btVector3(0,0,1); - btVector3 liftVelocity = btVector3(0,1,0); + btVector3 PinchFrictionVelocityLeft = btVector3(0,0,-2); + btVector3 PinchFrictionVelocityRight = btVector3(0,0,2); + btVector3 liftVelocity = btVector3(0,2,0); btVector3 shiftVelocity = btVector3(0,0,0); btVector3 holdVelocity = btVector3(0,0,0); btVector3 openVelocityLeft = btVector3(0,0,4); @@ -230,7 +230,8 @@ void PinchFriction::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(); getDeformableDynamicsWorld()->setSolverCallback(dynamics2); m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld); diff --git a/examples/DeformableDemo/VolumetricDeformable.cpp b/examples/DeformableDemo/VolumetricDeformable.cpp index d3a37d5bf..7eaf9aa37 100644 --- a/examples/DeformableDemo/VolumetricDeformable.cpp +++ b/examples/DeformableDemo/VolumetricDeformable.cpp @@ -169,6 +169,8 @@ void VolumetricDeformable::initPhysics() btVector3 gravity = btVector3(0, -100, 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); { @@ -223,7 +225,7 @@ void VolumetricDeformable::initPhysics() getDeformableDynamicsWorld()->addForce(psb, gravity_force); m_forces.push_back(gravity_force); - btDeformableNeoHookeanForce* neohookean = new btDeformableNeoHookeanForce(30,100,0.02); + btDeformableNeoHookeanForce* neohookean = new btDeformableNeoHookeanForce(30,100,0.05); getDeformableDynamicsWorld()->addForce(psb, neohookean); m_forces.push_back(neohookean); diff --git a/src/BulletDynamics/Featherstone/btMultiBodyInplaceSolverIslandCallback.h b/src/BulletDynamics/Featherstone/btMultiBodyInplaceSolverIslandCallback.h index 458e62a78..593f68d9a 100644 --- a/src/BulletDynamics/Featherstone/btMultiBodyInplaceSolverIslandCallback.h +++ b/src/BulletDynamics/Featherstone/btMultiBodyInplaceSolverIslandCallback.h @@ -188,7 +188,13 @@ struct MultiBodyInplaceSolverIslandCallback : public btSimulationIslandManager:: //} else { for (i = 0; i < numBodies; i++) - m_bodies.push_back(bodies[i]); + { + bool isSoftBodyType = (bodies[i]->getInternalType() & btCollisionObject::CO_SOFT_BODY); + if (!isSoftBodyType) + { + m_bodies.push_back(bodies[i]); + } + } for (i = 0; i < numManifolds; i++) m_manifolds.push_back(manifolds[i]); for (i = 0; i < numCurConstraints; i++)