add support for anchor constraint between deformable and rigid

This commit is contained in:
Xuchen Han
2019-10-16 19:23:01 -07:00
parent 3d622a3bee
commit 60dfe1fe69
11 changed files with 487 additions and 2 deletions

View File

@@ -140,6 +140,13 @@ void btDeformableMultiBodyDynamicsWorld::integrateTransforms(btScalar timeStep)
node.m_q = node.m_x;
node.m_vn = node.m_v;
}
// enforce anchor constraints
for (int j = 0; j < psb->m_deformableAnchors.size();++j)
{
btSoftBody::DeformableNodeRigidAnchor& a = psb->m_deformableAnchors[j];
btSoftBody::Node* n = a.m_node;
n->m_x = a.m_cti.m_colObj->getWorldTransform() * a.m_local;
}
psb->interpolateRenderMesh();
}
}