I recently found IRRLICHT , i must say it looks a very nice engine i found it v easy to get started doing stuff , one thing that i have been trying to do , if i import a mesh to create an scene node im just wondering is there a way to detect or show when its clicked on ? , i know i can detect when the camera is over it with collision detection but im looking to go off the mousepointer i.e keep the camera static , i know how to get the x,y coords of the mouse is there a way to see if their over a node?
Thanks for help
Clicking on a scene Node
This is the function you want.
Code: Select all
virtual ISceneNode* irr::scene::ISceneCollisionManager::getSceneNodeFromScreenCoordinatesBB ( core::position2d< s32 > pos,
s32 idBitMask = 0
) [pure virtual]
Returns the scene node, which is currently visible under the overgiven screencoordinates, viewed from the currently active camera. The collision tests are done using a bounding box for each scene node.
Parameters:
pos: Position in pixel screen coordinates, under which the returned scene node will be.
idBitMask: Only scene nodes with an id with bits set like in this mask will be tested. If the BitMask is 0, this feature is disabled.
Returns:
Returns the visible scene node under screen coordinates with matching bits in its id. If there is no scene node under this position, 0 is returned.
Crud, how do I do this again?
also check out the collision example for this..
in that example you can see this in use, for the picking of which faerie to have their lighting disabled. also a neat kinf of picking that shows which trangle the camera is looking at withing the node for the level, was very enlightening to me...
-ted
-ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net