What I'm finding is that my callback
Code: Select all
void CollisionCallback(btBroadphasePair &collisionPair, btCollisionDispatcher &dispatcher, const btDispatcherInfo &dispatchInfo) {
SDL_Log(
"Collision detected ( %d | %d )",
collisionPair.m_pProxy0->m_collisionFilterGroup,
collisionPair.m_pProxy1->m_collisionFilterGroup);
}
collisionDispatcher->setNearCallback(CollisionCallback);
My understanding was that these callbacks would trigger when the actual triangle mesh of the terrain was crossed.
I feel like I'm close, but I'm entirely sure how I should be handling this. The included Bullet Heightfield example doesn't use any callbacks, but seems to do manual raycasting for all rigidbodies in the world. Is that what I'm meant to be doing in this callback, a manual raycast? Or should I not be using this callback at all and every tick do manual raycasts for all rigidbodies in my world?