Actually, the problem is most likely that you are rendering the bounding box incorrectly. If the box changes shape or size when you rotate the node, then you are rendering the bounding box in world space. It sounds like you're expecting to see the bounding box in object space.
If you use
node->setDebugDataVisible(scene::EDS_BBOX), it should show the object space bounding box. The other option would be to render the box like this...
Code: Select all
const core::matrix4 mat = node->getAbsoluteTransformation();
driver->setTransform (video::ETS_WORLD, mat);
video::SMaterial mtl;
mtl.Lighting = false;
driver->setMaterial (mtl);
const core::aabbox3df box = node->getBoundingBox();
driver->draw3DBox(box, color);
I actually posted some example code to show the different boxes
here a long time ago. I'm pretty sure that the
matrix4::transformBox() implementation has changed, so you may see the same box for two of the functions now, but the code should be simple enough to show what is going on.
Travis