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?
Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
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
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.