virtual bool needsCollision(btBroadphaseProxy* proxy0) const { //don't collide with itself if (proxy0->m_clientObject == m_me) return false; ///don't do CCD when the collision filters are not matching if (!ClosestConvexResultCallback::needsCollision(proxy0)) return false; btCollisionObject* otherObj = (btCollisionObject*) proxy0->m_clientObject; //call needsResponse, see http://code.google.com/p/bullet/issues/detail?id=179 if (m_dispatcher->needsResponse(m_me,otherObj)) { ///don't do CCD when there are already contact points (touching contact/penetration) btAlignedObjectArray<btPersistentManifold*> manifoldArray; btBroadphasePair* collisionPair = m_pairCache->findPair(m_me->getBroadphaseHandle(),proxy0); if (collisionPair) { if (collisionPair->m_algorithm) { manifoldArray.resize(0); collisionPair->m_algorithm->getAllContactManifolds(manifoldArray); for (int j=0;j<manifoldArray.size();j++) { btPersistentManifold* manifold = manifoldArray[j]; if (manifold->getNumContacts()>0) return false; } } } } return true; }