I'm moving from BlitzMax and MiniB3d...
There was a function called CameraPick that returned the 3D pos of the collision between the mouse and a object.
I'm not sure I'm explaining this good.
So imagine you have a plane and you go with the mouse on it. I need to get the 3d coords of the mouse on the plane. or you could thing of selecting a 3D soldier in a 3d RTS. (that's what I'm trying to do).
How can I do that in Irrlicht? (I searched but didn't find anything good)
Camera Pick?
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Perhaps you need to do a RAY collision test with a mesh.
Here some code extracted for theIRRai editor from JP:
Hope that help...
Here some code extracted for theIRRai editor from JP:
Code: Select all
scene::ISceneCollisionManager* colmgr = smgr->getSceneCollisionManager();
core::line3df ray = colmgr->getRayFromScreenCoordinates(mousePos, smgr->getActiveCamera());
// Grab the node clicked on
scene::ISceneNode* clicked_node = colmgr->getSceneNodeFromRayBB(ray);
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Look in your Irrlicht SDK, in example/07.Collision/main.cpp
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way