First of all I import a .dwg drawing into 3d Studio max.
Screen Shot : http://megalomania666.com/xjobb/orginal.JPG
The drawing is made of about 28 different objects, I´m pretty sure about this because I dissected the drawing by moving them apart.
Screen Shot : http://megalomania666.com/xjobb/dissected.JPG
I export this file to MY3D, 3ds or OBJ and load it into the engine (which of the above formats I use does not matter) the engine "says" that it created 18 nodes.
Screen Shot : http://megalomania666.com/xjobb/console.JPG
I use this code to give each node an unique id number from 0 to as many nodes the scene contains
Code: Select all
int idValue = 0;
const core::list<scene::ISceneNode*>& children = smgr->getRootSceneNode()->getChildren();
core::list<scene::ISceneNode*>::Iterator it = children.begin();
for (; it != children.end(); ++it)
{
scene::ISceneNode* current = *(it);
current->setID(idValue++);
printf("%d" , idValue);
}
I have implemented a very basic collision handling where the left click on the mouse prints the node id on the console.
Code: Select all
selectedSceneNode = smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(camera);
printf("curr : %d\n" , selectedSceneNode->getID());
Here is my problem :
The thing is that it only sets 5 ids, the left mouse click never returns a -1 which must mean that all the nodes have been asigned a value.
I would be very happy if someone could tell me why the engine loads 18 nodes and only asign id number to 5 of them.
regs.
M666