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?
How to do picking with mouse click on nodes in Irrlicht
Members - Reputation: 280
Posted 02 February 2014 - 04:20 AM
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:
to find the first scene node intersecting this ray