Small example where to use it: lets say you have some table game with cubes and some constructions where all that cubes are attached (bounding box are overlaped). So you can't select your cube with mouse, because constructions bounding box is bigger and overlap cube.
How to solve it? Use getSceneNodeFromCameraBB and set the right idBitMask. idBitMask is s32, so you can have 32 different groups of nodes (1,2,4,8,16,32....2147483648). Lets say i need 500 cubes, so i set cubes id from 512 to 1012 and use getSceneNodeFromCameraBB(camera,512) to sort cubes nodes. 512 in binary is 100000000 and max in this group can be 1023 - binary 111111111. Mask 512 meens that at least one 1 bit in mask match with node id bit. So nodes id's from 512 to 1023 first binary digit is 1 and match mask.
Code: Select all
node1->setID(512);
node2->setID(5);
...................
selectedSceneNode = smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(cam,512);
//now you can select only node1, but not node2.
p.s. sorry for mistakes
Edit: for binary understanding try free Biscope, just set 32 bit, enter decimal number and you get binary.