Expose the multi-point perturbation algorithm for btConvexPlaneCollisionAlgorithm
Usage: m_collisionConfiguration = new btDefaultCollisionConfiguration(); m_collisionConfiguration->setPlaneConvexMultipointIterations(); It is only enabled for polyhedral convex shapes, because implicit/smooth surfaces such as spheres, cylinders, capsules and cones keep on rolling forever, due to the extra off-center contact points
This commit is contained in:
@@ -127,7 +127,10 @@ void btConvexPlaneCollisionAlgorithm::processCollision (btCollisionObject* body0
|
||||
resultOut->addContactPoint(normalOnSurfaceB,pOnB,distance);
|
||||
}
|
||||
|
||||
if (resultOut->getPersistentManifold()->getNumContacts()<m_minimumPointsPerturbationThreshold)
|
||||
//the perturbation algorithm doesn't work well with implicit surfaces such as spheres, cylinder and cones:
|
||||
//they keep on rolling forever because of the additional off-center contact points
|
||||
//so only enable the feature for polyhedral shapes (btBoxShape, btConvexHullShape etc)
|
||||
if (convexShape->isPolyhedral() && resultOut->getPersistentManifold()->getNumContacts()<m_minimumPointsPerturbationThreshold)
|
||||
{
|
||||
btVector3 v0,v1;
|
||||
btPlaneSpace1(planeNormal,v0,v1);
|
||||
|
||||
Reference in New Issue
Block a user