Avoid collision detection/response between anchored (static) soft body cluster and a static/kinematic rigid body

This commit is contained in:
erwin.coumans
2009-08-31 04:35:06 +00:00
parent 2ef7c1a457
commit 2d1777c899
3 changed files with 17 additions and 4 deletions

View File

@@ -2116,11 +2116,17 @@ void btSoftBody::initializeClusters()
c.m_masses.resize(c.m_nodes.size());
for(int j=0;j<c.m_nodes.size();++j)
{
c.m_masses[j] = c.m_nodes[j]->m_im>0?1/c.m_nodes[j]->m_im: BT_LARGE_FLOAT;
//c.m_masses[j] = c.m_nodes[j]->m_im>0?1/c.m_nodes[j]->m_im: 0.f;
if (c.m_nodes[j]->m_im==0)
{
c.m_containsAnchor = true;
c.m_masses[j] = BT_LARGE_FLOAT;
} else
{
c.m_masses[j] = btScalar(1.)/c.m_nodes[j]->m_im;
}
c.m_imass += c.m_masses[j];
}
c.m_imass = 1/c.m_imass;
c.m_imass = btScalar(1.)/c.m_imass;
c.m_com = btSoftBody::clusterCom(&c);
c.m_lv = btVector3(0,0,0);
c.m_av = btVector3(0,0,0);