Selecting a node with the mouse?

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
d4nm4n
Posts: 33
Joined: Fri Oct 09, 2009 11:28 pm

Selecting a node with the mouse?

Post by d4nm4n »

Is this possible? I am making an editor where i can drop instances of some loaded source meshes and need to be able to "get" the node i click on. I could not find any function in the API for this.
Can anyone help?

Thanx
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

In the collision manager you can trow some rays and get colliding node.
The exemple 7 should help you:
http://irrlicht.sourceforge.net/docu/example007.html
d4nm4n
Posts: 33
Joined: Fri Oct 09, 2009 11:28 pm

Post by d4nm4n »

well, i have tried getSceneNodeFromScreenCoordinatesBB but it seems to return the same node intptr no matter what.
SG57
Posts: 66
Joined: Fri May 18, 2007 5:51 am

Post by SG57 »

Remember, that is from the bounding box, so if you have a huge node (map level, terrain, floor, etc.) it will default to that since the camera is most likely inside the box.
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

d4nm4n
Posts: 33
Joined: Fri Oct 09, 2009 11:28 pm

Post by d4nm4n »

Great thanks!

I realised the problem was in the ID of the camera's pivot.

Still have the probelm that this only semms to work on bounding boxes though, how can i make it so it uses the mesh for picking?
Post Reply