Support btMultiBody soft contact using ERP and CFM. Also support custom relaxation parameter to allow successive over relaxation.

Added demos for rigid and multi body soft (compliant) contact.
Will also add simplified Hertz compliant contact, by dynamically modifying the ERP/CFM to mimic a non-linear spring.
Note that btManifoldPoint is growing too big, we need to implement proper contact constraints derived from btTypedConstraint.
This commit is contained in:
erwin coumans
2016-02-22 18:40:00 -08:00
parent a3154f7a56
commit 6c9bfce975
10 changed files with 435 additions and 19 deletions

View File

@@ -39,6 +39,7 @@ enum btContactPointFlags
{
BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED=1,
BT_CONTACT_FLAG_HAS_CONTACT_CFM=2,
BT_CONTACT_FLAG_HAS_CONTACT_ERP=4,
};
/// ManifoldContactPoint collects and maintains persistent contactpoints.
@@ -55,6 +56,7 @@ class btManifoldPoint
m_contactMotion1(0.f),
m_contactMotion2(0.f),
m_contactCFM(0.f),
m_contactERP(0.f),
m_frictionCFM(0.f),
m_lifeTime(0)
{
@@ -78,6 +80,7 @@ class btManifoldPoint
m_contactMotion1(0.f),
m_contactMotion2(0.f),
m_contactCFM(0.f),
m_contactERP(0.f),
m_frictionCFM(0.f),
m_lifeTime(0)
{
@@ -114,6 +117,8 @@ class btManifoldPoint
btScalar m_contactMotion1;
btScalar m_contactMotion2;
btScalar m_contactCFM;
btScalar m_contactERP;
btScalar m_frictionCFM;
int m_lifeTime;//lifetime of the contactpoint in frames