Fix a bug in softbody contact handling.

This commit is contained in:
yunfeibai 2016-11-03 12:14:39 -07:00
parent e8635932cf
commit ff2c79e6bc
2 changed files with 2 additions and 2 deletions

View File

@ -1658,7 +1658,7 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
pm->m_kLST = 1.0;
pm->m_flags -= btSoftBody::fMaterial::DebugDraw;
psb->generateBendingConstraints(2,pm);
psb->m_cfg.piterations = 20;
psb->m_cfg.piterations = 50;
psb->m_cfg.kDF = 0.5;
psb->randomizeConstraints();
psb->rotate(btQuaternion(0.70711,0,0,0.70711));

View File

@ -3036,6 +3036,7 @@ void btSoftBody::PSolve_RContacts(btSoftBody* psb, btScalar kst, btScalar ti)
btRigidBody* rigidCol;
btMultiBodyLinkCollider* multibodyLinkCol;
btScalar* deltaV;
btMultiBodyJacobianData jacobianData;
if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY)
{
rigidCol = (btRigidBody*)btRigidBody::upcast(cti.m_colObj);
@ -3047,7 +3048,6 @@ void btSoftBody::PSolve_RContacts(btSoftBody* psb, btScalar kst, btScalar ti)
if (multibodyLinkCol)
{
const int ndof = multibodyLinkCol->m_multiBody->getNumDofs() + 6;
btMultiBodyJacobianData jacobianData;
jacobianData.m_jacobians.resize(ndof);
jacobianData.m_deltaVelocitiesUnitImpulse.resize(ndof);
btScalar* jac=&jacobianData.m_jacobians[0];