Advertisement Jump to content
Sign in to follow this  

How to do picking with mouse click on nodes in Irrlicht

This topic is 1810 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?


Share this post

Link to post
Share on other sites



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



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!