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;
}

View File

@@ -135,7 +135,7 @@ ATTRIBUTE_ALIGNED16(struct) PfxSolverBody {
static SIMD_FORCE_INLINE vmVector3 btReadVector3(const double* p)
{
float tmp[3] = {p[0],p[1],p[2]};
float tmp[3] = {float(p[0]),float(p[1]),float(p[2])};
vmVector3 v;
loadXYZ(v, tmp);
return v;
@@ -143,7 +143,7 @@ static SIMD_FORCE_INLINE vmVector3 btReadVector3(const double* p)
static SIMD_FORCE_INLINE vmQuat btReadQuat(const double* p)
{
float tmp[4] = {p[0],p[1],p[2],p[4]};
float tmp[4] = {float(p[0]),float(p[1]),float(p[2]),float(p[4])};
vmQuat vq;
loadXYZW(vq, tmp);
return vq;