CCD and gContactProcessedCallback

Post Reply
inverse42
Posts: 3
Joined: Mon Dec 24, 2012 5:47 am

CCD and gContactProcessedCallback

Post by inverse42 »

I am trying to use CCD to prevent bullets from passing through an object. The CCD part works fine, but when it is a CCD collision there is no callback to the game to report the collision. This means that instead of getting destroyed on collision, some of these objects just ricochet of in random directions.

I added the usual callback to the bottom of the last if() statement in btDiscreteDynamicsWorld::createPredictiveContacts(...), as all of the relevant data appears to exist at that point:

Code: Select all

	if(gContactProcessedCallback)
		(*gContactProcessedCallback)(pt, body, (void *)sweepResults.m_hitCollisionObject);
I'm not sure if this is the correct fix or if it would be better to add a CCD-specific contact callback, but this seems to do what I expect now.
Post Reply