I am not sure what function in ISceneCollisionManager I can use to do picking of objects.
I want to click on mesh nodes or whatever is on screen and get that object which was clicked on by the mouse pointer?
Thanks!
How to do picking with mouse click on nodes in Irrlicht
Hey,
The simplest method is using: ISceneCollisionManager::getSceneNodeFromScreenCoordinatesBB
This method only takes bounding boxes into consideration though, if you need more precision you should probably use
line3d<f32> ray = colmgr->getRayFromScreenCoordinates(device->getCursorControl()->getPosition(), camera);
This returns a ray which goes though the camera and points to where the cursor is pointing, then use:
ISceneCollisionManager::getSceneNodeAndCollisionPointFromRay
to find the first scene node intersecting this ray
links:
http://irrlicht.sourceforge.net/forum/viewtopic.php?t=38725
http://irrlicht.sourceforge.net/docu/classirr_1_1scene_1_1_i_scene_collision_manager.html
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement