use a separate default cfm for the MLCP solver, it is a very sensitive value for Dantzig (and Lemke)
This commit is contained in:
@@ -22,7 +22,8 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
btMLCPSolver::btMLCPSolver( btMLCPSolverInterface* solver)
|
btMLCPSolver::btMLCPSolver( btMLCPSolverInterface* solver)
|
||||||
:m_solver(solver),
|
:m_solver(solver),
|
||||||
m_fallback(0)
|
m_fallback(0),
|
||||||
|
m_cfm(0.000001)//0.0000001
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,7 +436,7 @@ void btMLCPSolver::createMLCPFast(const btContactSolverInfo& infoGlobal)
|
|||||||
// add cfm to the diagonal of m_A
|
// add cfm to the diagonal of m_A
|
||||||
for ( int i=0; i<m_A.rows(); ++i)
|
for ( int i=0; i<m_A.rows(); ++i)
|
||||||
{
|
{
|
||||||
m_A.setElem(i,i,m_A(i,i)+ infoGlobal.m_globalCfm / infoGlobal.m_timeStep);
|
m_A.setElem(i,i,m_A(i,i)+ m_cfm / infoGlobal.m_timeStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,7 +564,7 @@ void btMLCPSolver::createMLCP(const btContactSolverInfo& infoGlobal)
|
|||||||
// add cfm to the diagonal of m_A
|
// add cfm to the diagonal of m_A
|
||||||
for ( int i=0; i<m_A.rows(); ++i)
|
for ( int i=0; i<m_A.rows(); ++i)
|
||||||
{
|
{
|
||||||
m_A.setElem(i,i,m_A(i,i)+ infoGlobal.m_globalCfm / infoGlobal.m_timeStep);
|
m_A.setElem(i,i,m_A(i,i)+ m_cfm / infoGlobal.m_timeStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ protected:
|
|||||||
btConstraintArray m_allConstraintArray;
|
btConstraintArray m_allConstraintArray;
|
||||||
btMLCPSolverInterface* m_solver;
|
btMLCPSolverInterface* m_solver;
|
||||||
int m_fallback;
|
int m_fallback;
|
||||||
|
btScalar m_cfm;
|
||||||
|
|
||||||
virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject** bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
|
virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject** bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
|
||||||
virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
|
virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer);
|
||||||
@@ -70,6 +71,15 @@ public:
|
|||||||
m_fallback = num;
|
m_fallback = num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btScalar getCfm() const
|
||||||
|
{
|
||||||
|
return m_cfm;
|
||||||
|
}
|
||||||
|
void setCfm(btScalar cfm)
|
||||||
|
{
|
||||||
|
m_cfm = cfm;
|
||||||
|
}
|
||||||
|
|
||||||
virtual btConstraintSolverType getSolverType() const
|
virtual btConstraintSolverType getSolverType() const
|
||||||
{
|
{
|
||||||
return BT_MLCP_SOLVER;
|
return BT_MLCP_SOLVER;
|
||||||
|
|||||||
Reference in New Issue
Block a user