fixed and re-enabled sphere-sphere collision: contact points were not properly removed/refreshed.
This commit is contained in:
@@ -216,12 +216,11 @@ btCollisionAlgorithmCreateFunc* btDefaultCollisionConfiguration::getCollisionAlg
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
|
|
||||||
if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
|
if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
|
||||||
{
|
{
|
||||||
//return m_sphereSphereCF;
|
return m_sphereSphereCF;
|
||||||
}
|
}
|
||||||
|
#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
|
||||||
if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==BOX_SHAPE_PROXYTYPE))
|
if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==BOX_SHAPE_PROXYTYPE))
|
||||||
{
|
{
|
||||||
return m_sphereBoxCF;
|
return m_sphereBoxCF;
|
||||||
|
|||||||
@@ -56,11 +56,16 @@ void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0
|
|||||||
btScalar radius0 = sphere0->getRadius();
|
btScalar radius0 = sphere0->getRadius();
|
||||||
btScalar radius1 = sphere1->getRadius();
|
btScalar radius1 = sphere1->getRadius();
|
||||||
|
|
||||||
//m_manifoldPtr->clearManifold(); //don't do this, it disables warmstarting
|
#ifdef CLEAR_MANIFOLD
|
||||||
|
m_manifoldPtr->clearManifold(); //don't do this, it disables warmstarting
|
||||||
|
#endif
|
||||||
|
|
||||||
///iff distance positive, don't generate a new contact
|
///iff distance positive, don't generate a new contact
|
||||||
if ( len > (radius0+radius1))
|
if ( len > (radius0+radius1))
|
||||||
{
|
{
|
||||||
|
#ifndef CLEAR_MANIFOLD
|
||||||
|
resultOut->refreshContactPoints();
|
||||||
|
#endif //CLEAR_MANIFOLD
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///distance (negative means penetration)
|
///distance (negative means penetration)
|
||||||
@@ -82,7 +87,9 @@ void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0
|
|||||||
|
|
||||||
resultOut->addContactPoint(normalOnSurfaceB,pos1,dist);
|
resultOut->addContactPoint(normalOnSurfaceB,pos1,dist);
|
||||||
|
|
||||||
//no resultOut->refreshContactPoints(); needed, because of clearManifold (all points are new)
|
#ifndef CLEAR_MANIFOLD
|
||||||
|
resultOut->refreshContactPoints();
|
||||||
|
#endif //CLEAR_MANIFOLD
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user