CCD and broadphase filter callback

Courtland
Posts: 1
Joined: Tue Oct 30, 2012 1:38 am

CCD and broadphase filter callback

Post by Courtland »

Hi -

Having really good luck with bullet so far. Well designed, offers a lot of functionality at an unbeatable price. I'm having trouble with the btOverlapFilterCallback when I'm using CCD. I have some fast moving objects that have CCD enabled, and the result of needBroadphaseCollision() seems to be ignored for them -- the contacts appear to be added when predictive contacts are processed. An easy test case: in CcdPhysicsDemo, add

struct NoFilterCallback : public btOverlapFilterCallback
{
virtual bool needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const
{
return false;
}
};

And then
m_dynamicsWorld->getPairCache()->setOverlapFilterCallback(new NoFilterCallback);
before:
m_dynamicsWorld->setGravity(btVector3(0,-10,0));

When you run the demo, the cubes will fall through the floor, so you have to act quickly and reset with p often. With CCD mode on, projectiles you shoot will still hit the falling boxes. When CCD is off, they won't collide (you can turn the velocity down by setting m_ShootBoxInitialSpeed = 200.f). With CCD on, they do collide.

Is this a bug, or am I misunderstanding how ccd interacts with the broadphase callback? If it's working as designed, what callback should I override so I can provide my own filtering for ccd objects.

Thanks for this amazing library.

-Courtland