Made btCollisionWorld::convexSweepTest and btGhostObject::convexSweepTest consistent. Both have an optional last argument for allowedCcdPenetration.

Bugfix due to recent change in friction in constraint solver.
This commit is contained in:
erwin.coumans
2008-11-19 19:55:14 +00:00
parent 50344c4a23
commit decf91a34d
8 changed files with 25 additions and 17 deletions

View File

@@ -765,7 +765,7 @@ struct btSingleSweepCallback : public btBroadphaseRayCallback
void btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, ConvexResultCallback& resultCallback) const
void btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration) const
{
BT_PROFILE("convexSweepTest");
@@ -793,7 +793,7 @@ void btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btT
#ifndef USE_BRUTEFORCE_RAYBROADPHASE
btSingleSweepCallback convexCB(castShape,convexFromWorld,convexToWorld,this,resultCallback,getDispatchInfo().m_allowedCcdPenetration);
btSingleSweepCallback convexCB(castShape,convexFromWorld,convexToWorld,this,resultCallback,allowedCcdPenetration);
m_broadphasePairCache->rayTest(convexFromTrans.getOrigin(),convexToTrans.getOrigin(),convexCB,castShapeAabbMin,castShapeAabbMax);
@@ -819,7 +819,7 @@ void btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btT
collisionObject->getCollisionShape(),
collisionObject->getWorldTransform(),
resultCallback,
getDispatchInfo().m_allowedCcdPenetration);
allowedCcdPenetration);
}
}
}

View File

@@ -353,7 +353,7 @@ public:
// convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback
// This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.
void convexSweepTest (const btConvexShape* castShape, const btTransform& from, const btTransform& to, ConvexResultCallback& resultCallback) const;
void convexSweepTest (const btConvexShape* castShape, const btTransform& from, const btTransform& to, ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration = btScalar(0.)) const;
/// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest.

View File

@@ -98,7 +98,7 @@ void btPairCachingGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy
}
void btGhostObject::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btScalar allowedCcdPenetration, btCollisionWorld::ConvexResultCallback& resultCallback) const
void btGhostObject::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration) const
{
btTransform convexFromTrans,convexToTrans;
convexFromTrans = convexFromWorld;

View File

@@ -43,7 +43,7 @@ public:
virtual ~btGhostObject();
void convexSweepTest(const class btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btScalar allowedCcdPenetration,btCollisionWorld::ConvexResultCallback& resultCallback) const;
void convexSweepTest(const class btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration = 0.f) const;
void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const;

View File

@@ -32,6 +32,8 @@ class btManifoldPoint
:m_userPersistentData(0),
m_appliedImpulse(0.f),
m_lateralFrictionInitialized(false),
m_appliedImpulseLateral1(0.f),
m_appliedImpulseLateral2(0.f),
m_lifeTime(0)
{
}