mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-08-22 02:58:32 +00:00
Merge pull request #2620 from stephengold/master
apply custom pair-cache filter to predictive contacts
This commit is contained in:
@@ -61,7 +61,8 @@ public:
|
||||
virtual void cleanOverlappingPair(btBroadphasePair& pair, btDispatcher* dispatcher) = 0;
|
||||
|
||||
virtual int getNumOverlappingPairs() const = 0;
|
||||
|
||||
virtual bool needsBroadphaseCollision(btBroadphaseProxy * proxy0, btBroadphaseProxy * proxy1) const = 0;
|
||||
virtual btOverlapFilterCallback* getOverlapFilterCallback() = 0;
|
||||
virtual void cleanProxyFromPairs(btBroadphaseProxy* proxy, btDispatcher* dispatcher) = 0;
|
||||
|
||||
virtual void setOverlapFilterCallback(btOverlapFilterCallback* callback) = 0;
|
||||
@@ -380,6 +381,14 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool needsBroadphaseCollision(btBroadphaseProxy*, btBroadphaseProxy*) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
btOverlapFilterCallback* getOverlapFilterCallback()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual void setOverlapFilterCallback(btOverlapFilterCallback* /*callback*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -800,6 +800,14 @@ public:
|
||||
///don't do CCD when the collision filters are not matching
|
||||
if (!ClosestConvexResultCallback::needsCollision(proxy0))
|
||||
return false;
|
||||
if (m_pairCache->getOverlapFilterCallback()) {
|
||||
btBroadphaseProxy* proxy1 = m_me->getBroadphaseHandle();
|
||||
bool collides = m_pairCache->needsBroadphaseCollision(proxy0, proxy1);
|
||||
if (!collides)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
btCollisionObject* otherObj = (btCollisionObject*)proxy0->m_clientObject;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user