Fix friction and restitution in BulletMultiThreaded (collision detection and parallel solver)

Thanks to lsgmasa for reporting, see http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1758
This commit is contained in:
ejcoumans
2007-12-12 03:41:35 +00:00
parent 947dc8d33d
commit 8d10a6ba1d
4 changed files with 48 additions and 12 deletions

View File

@@ -1062,15 +1062,14 @@ void processSolverTask(void* userPtr, void* lsMemory)
};
btScalar penVel = -constraint.m_penetration/taskDesc.m_commandData.m_manifoldSetup.m_solverInfo.m_timeStep;
if (rest > penVel)
{
rest = btScalar(0.);
}
constraint.m_restitution = rest;
constraint.m_penetration *=
-(taskDesc.m_commandData.m_manifoldSetup.m_solverInfo.m_erp/taskDesc.m_commandData.m_manifoldSetup.m_solverInfo.m_timeStep);
if (rest > penVel)
{
constraint.m_penetration = btScalar(0.);
}
constraint.m_restitution = rest;
constraint.m_appliedImpulse = 0.f;