summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuchen Han <xuchenhan@xuchenhan-macbookpro.roam.corp.google.com>2019-07-12 13:26:58 -0700
committerXuchen Han <xuchenhan@xuchenhan-macbookpro.roam.corp.google.com>2019-08-02 13:12:42 -0700
commitac628f4d394f39d10cd178e005b63ad7dda0e1f0 (patch)
tree7c387171a5b399f7c406bbc1337f104e90dbebfe
parent98cd9a85e4416686e099969332691c91b60a3468 (diff)
downloadbullet3-ac628f4d394f39d10cd178e005b63ad7dda0e1f0.tar.gz
add two way coupled penetration resolution; not momentum conserving, but seem to work fine
-rw-r--r--src/BulletSoftBody/btDeformableBodySolver.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/BulletSoftBody/btDeformableBodySolver.cpp b/src/BulletSoftBody/btDeformableBodySolver.cpp
index b7c531385..41a5df70d 100644
--- a/src/BulletSoftBody/btDeformableBodySolver.cpp
+++ b/src/BulletSoftBody/btDeformableBodySolver.cpp
@@ -87,21 +87,22 @@ void btDeformableBodySolver::postStabilize()
if (dp < 0)
{
c.m_node->m_x -= dp * cti.m_normal * c.m_c4;
+// c.m_node->m_x -= impulse * c.m_c2;
////
-// if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY)
-// {
-// if (rigidCol)
-// rigidCol->applyImpulse(impulse, c.m_c1);
-// }
-// else if (cti.m_colObj->getInternalType() == btCollisionObject::CO_FEATHERSTONE_LINK)
-// {
-// if (multibodyLinkCol)
-// {
-// double multiplier = 0.5;
-// multibodyLinkCol->m_multiBody->applyDeltaVeeMultiDof(deltaV, -impulse.length() * multiplier);
-// }
-// }
+ if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY)
+ {
+ if (rigidCol)
+ rigidCol->applyImpulse(impulse, c.m_c1);
+ }
+ else if (cti.m_colObj->getInternalType() == btCollisionObject::CO_FEATHERSTONE_LINK)
+ {
+ if (multibodyLinkCol)
+ {
+ double multiplier = 0.5;
+ multibodyLinkCol->m_multiBody->applyDeltaVeeMultiDof(deltaV, -impulse.length() * multiplier);
+ }
+ }
}
}
}