Problems with getSceneNodeFromScreenCoordinatesBB

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
Guest

Problems with getSceneNodeFromScreenCoordinatesBB

Post by Guest »

The Function getSceneNodeFromScreenCoordinatesBB() returns the SceneNode which is under the cursor, for example, and which id is 9.

Code: Select all


// The Mesh
room = smgr->addMeshSceneNode(tangentMesh,NULL,10);

core::vector3df cursor = device->getCursorControl()->getPosition();
scene::ISceneNode* selectedMesh;
selectedMesh = smgr->getSceneCollisionManager()->getSceneNodeFromScreenCoordinatesBB(coursor,10);
With this code the getSceneNodeFromScreenCoordinatesBB() returns the room for example.
But there are also other Nodes in the scene, too.
And the getSceneNodeFromScreenCoordinatesBB() returns also the other Nodes,too, although these other Nodes have different ID's.
Why is the function returning these, too?
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Read this post: http://irrlicht.sourceforge.net/phpBB2/ ... =idbitmask
You need to understand what mean idBitMask first.
Guest

Post by Guest »

Oh ok thanks
FBI
Posts: 1
Joined: Sat Mar 04, 2006 5:33 am
Location: USA

level node gets picked when using getSceneNode....

Post by FBI »

The above link clears up the confusion about how the bitMask works, but I found that I also have to set the ID of the baseLevel node to 0 so that it still doesn't get returned. I'm sure there are better ways to do this, but this worked for me.
Post Reply