Code: Select all
core::aabbox3d <f32> b=MyBat->node->getBoundingBox();
for (int i=0; i<5; i++) {
if (b.intersectsWithBox(Rooby[i]->node->getBoundingBox()))
MessageBox(g_hWnd, "Collided!" ,"Good news", MB_OK);
}Code: Select all
core::aabbox3d <f32> b=MyBat->node->getBoundingBox();
for (int i=0; i<5; i++) {
if (b.intersectsWithBox(Rooby[i]->node->getBoundingBox()))
MessageBox(g_hWnd, "Collided!" ,"Good news", MB_OK);
}So you must transform both the bat bounding box and the balls bounding box to see if they collide.//! Returns the axis aligned, not transformed bounding box of this node.
//! This means that if this node is a animated 3d character, moving in a room,
//! the bounding box will always be around the origin. To get the box in
//! real world coordinates, just transform it with the matrix you receive with
//! getAbsoluteTransformation() or simply use getTransformedBoundingBox(),
//! which does the same.