Demos/ConvexHullDistance/ConvexHullDistanceDemo.cpp to compile again

Allow to use convexProcessingThreshold as maximum distance for convex-convex computation (useful for closest distance/point computation)
This commit is contained in:
erwin.coumans
2010-08-25 01:28:46 +00:00
parent 32714313a8
commit 958c705a02
5 changed files with 322 additions and 34 deletions

View File

@@ -48,6 +48,7 @@ struct btDispatcherInfo
m_allowedCcdPenetration(btScalar(0.04)),
m_useConvexConservativeDistanceUtil(false),
m_convexConservativeDistanceThreshold(0.0f),
m_convexMaxDistanceUseCPT(false),
m_stackAllocator(0)
{
@@ -64,6 +65,7 @@ struct btDispatcherInfo
btScalar m_allowedCcdPenetration;
bool m_useConvexConservativeDistanceUtil;
btScalar m_convexConservativeDistanceThreshold;
bool m_convexMaxDistanceUseCPT;
btStackAlloc* m_stackAllocator;
};

View File

@@ -357,7 +357,13 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl
} else
#endif //USE_SEPDISTANCE_UTIL2
{
input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold();
if (dispatchInfo.m_convexMaxDistanceUseCPT)
{
input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactProcessingThreshold();
} else
{
input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold();
}
input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared;
}