summaryrefslogtreecommitdiff
path: root/src/BulletSoftBody/btDeformableContactConstraint.cpp
diff options
context:
space:
mode:
authorerwincoumans <erwin.coumans@gmail.com>2023-02-24 10:54:03 -0800
committerGitHub <noreply@github.com>2023-02-24 10:54:03 -0800
commit0e59474e1cf1fd69e3ca512826cfbe15cd6a9cec (patch)
tree593ed49f85b6478f536cfe9118d1f2e99597f3bc /src/BulletSoftBody/btDeformableContactConstraint.cpp
parentc037d9ba279d74c7e7437a700763892a6ba75760 (diff)
parente323404ac393aeb834a3f8f21549e119c76b67ff (diff)
downloadbullet3-0e59474e1cf1fd69e3ca512826cfbe15cd6a9cec.tar.gz
Merge pull request #4413 from aprilprojecteu/master
re-enable softbody/rigidbody contact report
Diffstat (limited to 'src/BulletSoftBody/btDeformableContactConstraint.cpp')
-rw-r--r--src/BulletSoftBody/btDeformableContactConstraint.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/BulletSoftBody/btDeformableContactConstraint.cpp b/src/BulletSoftBody/btDeformableContactConstraint.cpp
index 09398d79a..9c8e72f50 100644
--- a/src/BulletSoftBody/btDeformableContactConstraint.cpp
+++ b/src/BulletSoftBody/btDeformableContactConstraint.cpp
@@ -268,7 +268,7 @@ btScalar btDeformableRigidContactConstraint::solveConstraint(const btContactSolv
{
dn += m_penetration * infoGlobal.m_deformable_erp / infoGlobal.m_timeStep;
}
- // dn is the normal component of velocity diffrerence. Approximates the residual. // todo xuchenhan@: this prob needs to be scaled by dt
+ // dn is the normal component of velocity difference. Approximates the residual. // todo xuchenhan@: this prob needs to be scaled by dt
btVector3 impulse = m_contact->m_c0 * (vr + m_total_normal_dv * infoGlobal.m_deformable_cfm + ((m_penetration > 0) ? m_penetration / infoGlobal.m_timeStep * cti.m_normal : btVector3(0, 0, 0)));
if (!infoGlobal.m_splitImpulse)
{
@@ -487,6 +487,9 @@ void btDeformableFaceRigidContactConstraint::applyImpulse(const btVector3& impul
btVector3 dv = impulse * contact->m_c2;
btSoftBody::Face* face = contact->m_face;
+ // save applied impulse
+ contact->m_cti.m_impulse = impulse;
+
btVector3& v0 = face->m_n[0]->m_v;
btVector3& v1 = face->m_n[1]->m_v;
btVector3& v2 = face->m_n[2]->m_v;