From 2f9184acc98041eadb396cc153a002757d5ab257 Mon Sep 17 00:00:00 2001 From: Xuchen Han Date: Thu, 19 Sep 2019 16:57:25 -0700 Subject: [PATCH] remove position correction --- .../btDeformableMultiBodyDynamicsWorld.cpp | 74 ------------------- 1 file changed, 74 deletions(-) diff --git a/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp b/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp index 39d2d61bb..0d5067339 100644 --- a/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp +++ b/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp @@ -69,80 +69,6 @@ void btDeformableMultiBodyDynamicsWorld::internalSingleStepSimulation(btScalar t // End solver-wise simulation step // /////////////////////////////// } -// -//void btDeformableMultiBodyDynamicsWorld::positionCorrection(btScalar timeStep) -//{ -// // perform position correction for all constraints -// BT_PROFILE("positionCorrection"); -// for (int index = 0; index < m_deformableBodySolver->m_objective->m_projection.m_constraints.size(); ++index) -// { -// DeformableContactConstraint& constraint = *m_deformableBodySolver->m_objective->m_projection.m_constraints.getAtIndex(index); -// for (int j = 0; j < constraint.m_contact.size(); ++j) -// { -// const btSoftBody::RContact* c = constraint.m_contact[j]; -// // skip anchor points -// if (c == NULL || c->m_node->m_im == 0) -// continue; -// const btSoftBody::sCti& cti = c->m_cti; -// btVector3 va(0, 0, 0); -// -// // grab the velocity of the rigid body -// if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY) -// { -// btRigidBody* rigidCol = (btRigidBody*)btRigidBody::upcast(cti.m_colObj); -// va = rigidCol ? (rigidCol->getVelocityInLocalPoint(c->m_c1)): btVector3(0, 0, 0); -// } -// else if (cti.m_colObj->getInternalType() == btCollisionObject::CO_FEATHERSTONE_LINK) -// { -// btMultiBodyLinkCollider* multibodyLinkCol = (btMultiBodyLinkCollider*)btMultiBodyLinkCollider::upcast(cti.m_colObj); -// if (multibodyLinkCol) -// { -// const int ndof = multibodyLinkCol->m_multiBody->getNumDofs() + 6; -// const btScalar* J_n = &c->jacobianData_normal.m_jacobians[0]; -// const btScalar* J_t1 = &c->jacobianData_t1.m_jacobians[0]; -// const btScalar* J_t2 = &c->jacobianData_t2.m_jacobians[0]; -// const btScalar* local_v = multibodyLinkCol->m_multiBody->getVelocityVector(); -// // add in the normal component of the va -// btScalar vel = 0.0; -// for (int k = 0; k < ndof; ++k) -// { -// vel += local_v[k] * J_n[k]; -// } -// va = cti.m_normal * vel; -// -// vel = 0.0; -// for (int k = 0; k < ndof; ++k) -// { -// vel += local_v[k] * J_t1[k]; -// } -// va += c->t1 * vel; -// vel = 0.0; -// for (int k = 0; k < ndof; ++k) -// { -// vel += local_v[k] * J_t2[k]; -// } -// va += c->t2 * vel; -// } -// } -// else -// { -// // The object interacting with deformable node is not supported for position correction -// btAssert(false); -// } -// -// if (cti.m_colObj->hasContactResponse()) -// { -// btScalar dp = cti.m_offset; -// -// // only perform position correction when penetrating -// if (dp < 0) -// { -// c->m_node->m_v -= dp * cti.m_normal / timeStep; -// } -// } -// } -// } -//} void btDeformableMultiBodyDynamicsWorld::integrateTransforms(btScalar timeStep) {