getSceneNodeFromCameraBB return node behind walls

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Mh025
Posts: 16
Joined: Wed Jul 11, 2007 4:10 pm

getSceneNodeFromCameraBB return node behind walls

Post by Mh025 »

Hello,
I'm making an fps and i'm using the function getSceneNodeFromCameraBB when i shoot for check if the enemy has been hit:

Code: Select all

scene::ISceneNode*  selectedSceneNode = 0;
selectedSceneNode = smgr->getSceneCollisionManager()-> getSceneNodeFromCameraBB(camera);
           for(int i=0;i<MAX_ENEMY;i++)
           {
                   if(selectedSceneNode == enemy[i].node) 
                   {
                      printf("Hitted enemy %d \n", i);    
                      enemy[i].life -= weapon[currentweapon].danno;
                      if(enemy[i].vita <= 0)  
                      {
                           printf("Enemy %d death\n", i);
                           smgr->addToDeletionQueue(enemy[i].node);
                           camera->removeAnimator(animcam[i]);      
                           enemy[i].node = 0;                       /
                      }
                   }
           }         
 
All seems to work good, but i have noticed a bug, if I shoot to a wall where behind there is an enemy, the getSceneNodeFromCameraBB return the node of the enemy and not the wall, allowing to shoot an enemy through the walls!!
What I have to do for fix this problem? I must use newton raycast, is a know bug or i have forgotten some thing?
Mh025
Posts: 16
Joined: Wed Jul 11, 2007 4:10 pm

Post by Mh025 »

No help?
....
Post Reply