I load information data from an .HKX file and had a problem with the broadphase size.
I added the following code to adjust the broadphse size to include all rigid bodies in the loaded file (this is done before the world creation)
// calculate broadphase data
for ( int i = 0; i < m_physicsData->getPhysicsSystems().getSize(); ++i )
const hkArray& bodies = m_physicsData->getPhysicsSystems()[i]->getRigidBodies();
for ( int j=0; j < bodies.getSize(); j++ )
but still sometimes I encounter rigid bodies that are out of the broadphase the moment I add them. It happen with large rigid bodies (like the terrain). Why are there bodies that get out of their AABB?
I thought about adding some factor to the size of th broadphase but as I don't know why the rigid bodies are larger then the AABB I don't know what will be an appropriate scaling factor? I'll be happy for an exlpanation of what happen here.