+ make compound versus soft body work (soft body uses interpolated transform)

+ fixed issue with persistent manifold, warmstarting values were not initialized properly
+ don't clear manifold in sphere-sphere collision (need warmstarting)
+ added support for 'split impulse', decouple positional error correction from velocity correction
This avoids adding momentum due to penetration correction, it can be tuned using following variables:
solverInfo.m_splitImpulse = true/false (disable/enable)
solverInfo.m_splitImpulsePenetrationThreshold (below this value, baumgarte/mixed velocity/penetration is used (cheaper, looks more plausible)
solverInfo.m_linearSlop (less jitter, when small amound of penetration is allowed)
This commit is contained in:
erwin.coumans
2008-05-23 09:05:37 +00:00
parent ea86559480
commit 561066af75
13 changed files with 1611 additions and 1394 deletions

View File

@@ -26,7 +26,12 @@ struct btContactSolverInfoData
int m_numIterations;
btScalar m_maxErrorReduction;
btScalar m_sor;
btScalar m_erp;
btScalar m_erp;//used as Baumgarte factor
bool m_splitImpulse;
btScalar m_splitImpulsePenetrationThreshold;
btScalar m_linearSlop;
};
@@ -41,11 +46,12 @@ struct btContactSolverInfo : public btContactSolverInfoData
m_restitution = btScalar(0.);
m_maxErrorReduction = btScalar(20.);
m_numIterations = 10;
m_erp = btScalar(0.4);
m_erp = btScalar(0.2);
m_sor = btScalar(1.3);
m_splitImpulse = true;
m_splitImpulsePenetrationThreshold = 1.f;
m_linearSlop = 0.0002f;
}
};
#endif //CONTACT_SOLVER_INFO