diff --git a/src/BulletDynamics/Featherstone/btMultiBody.cpp b/src/BulletDynamics/Featherstone/btMultiBody.cpp index 654f77c09..bdaa47347 100644 --- a/src/BulletDynamics/Featherstone/btMultiBody.cpp +++ b/src/BulletDynamics/Featherstone/btMultiBody.cpp @@ -1707,9 +1707,9 @@ void btMultiBody::predictPositionsMultiDof(btScalar dt) { //reset to current pos - for (int i = 0; i < 4; ++i) + for (int j = 0; j < 4; ++j) { - pJointPos[i] = m_links[i].m_jointPos[i]; + pJointPos[j] = m_links[i].m_jointPos[j]; } btVector3 jointVel; @@ -1725,9 +1725,9 @@ void btMultiBody::predictPositionsMultiDof(btScalar dt) } case btMultibodyLink::ePlanar: { - for (int i = 0; i < 3; ++i) + for (int j = 0; j < 3; ++j) { - pJointPos[i] = m_links[i].m_jointPos[i]; + pJointPos[j] = m_links[i].m_jointPos[j]; } pJointPos[0] += dt * getJointVelMultiDof(i)[0]; diff --git a/src/BulletSoftBody/btDeformableBodySolver.cpp b/src/BulletSoftBody/btDeformableBodySolver.cpp index 03a9be07e..f7a26e01e 100644 --- a/src/BulletSoftBody/btDeformableBodySolver.cpp +++ b/src/BulletSoftBody/btDeformableBodySolver.cpp @@ -30,14 +30,9 @@ btDeformableBodySolver::~btDeformableBodySolver() delete m_objective; } -void btDeformableBodySolver::solveDeformableConstraints(float solverdt) +void btDeformableBodySolver::solveDeformableConstraints(btScalar solverdt) { BT_PROFILE("solveConstraints"); - // save v_{n+1}^* velocity after explicit forces -// backupVelocity(); - - // add constraints to the solver -// setConstraints(); m_objective->computeResidual(solverdt, m_residual); m_objective->applyDynamicFriction(m_residual); computeStep(m_dv, m_residual); @@ -147,7 +142,7 @@ bool btDeformableBodySolver::updateNodes() } -void btDeformableBodySolver::predictMotion(float solverdt) +void btDeformableBodySolver::predictMotion(btScalar solverdt) { for (int i = 0; i < m_softBodySet.size(); ++i) { diff --git a/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp b/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp index 825e7cd66..95f9b48b5 100644 --- a/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp +++ b/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp @@ -196,6 +196,7 @@ void btDeformableMultiBodyDynamicsWorld::solveMultiBodyConstraints() btMultiBodyDynamicsWorld::processConstraintsAndDeltaVee(); m_deformableBodySolver->solveContactConstraints(); } + // todo @xuchenhan: add joint force feedback } void btDeformableMultiBodyDynamicsWorld::addSoftBody(btSoftBody* body, int collisionFilterGroup, int collisionFilterMask)