From 7f6131f0cc3bf8dc7f6c627febeb80a7d456c181 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Tue, 31 Jul 2012 17:02:40 +0000 Subject: [PATCH] fix soft body friction value, Issue 613 Thanks to Jarno for the report and fix. --- src/BulletSoftBody/btSoftBodyInternals.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BulletSoftBody/btSoftBodyInternals.h b/src/BulletSoftBody/btSoftBodyInternals.h index efb2948a6..dd5fd2434 100644 --- a/src/BulletSoftBody/btSoftBodyInternals.h +++ b/src/BulletSoftBody/btSoftBodyInternals.h @@ -702,7 +702,7 @@ struct btSoftColliders joint.m_normal = norm; // printf("normal=%f,%f,%f\n",res.normal.getX(),res.normal.getY(),res.normal.getZ()); joint.m_delete = false; - joint.m_friction = fv.length2()<(-rvac*friction)?1:friction; + joint.m_friction = fv.length2()<(rvac*friction*rvac*friction)?1:friction; joint.m_massmatrix = ImpulseMatrix( ba.invMass(),ba.invWorldInertia(),joint.m_rpos[0], bb.invMass(),bb.invWorldInertia(),joint.m_rpos[1]); @@ -863,7 +863,7 @@ struct btSoftColliders c.m_c0 = ImpulseMatrix(psb->m_sst.sdt,ima,imb,iwi,ra); c.m_c1 = ra; c.m_c2 = ima*psb->m_sst.sdt; - c.m_c3 = fv.length2()<(btFabs(dn)*fc)?0:1-fc; + c.m_c3 = fv.length2()<(dn*fc*dn*fc)?0:1-fc; c.m_c4 = m_colObj1Wrap->getCollisionObject()->isStaticOrKinematicObject()?psb->m_cfg.kKHR:psb->m_cfg.kCHR; psb->m_rcontacts.push_back(c); if (m_rigidBody)