it works for me, so you do something wrong. i give you some code:
Code: Select all
ISceneNode* getMousePickingNode()
{
ISceneNode* Node;
Node = CollisionManager->getSceneNodeFromScreenCoordinatesBB(
CursorControl->getPosition(), 0);
if(Node == 0){return 0;}
else{return Node;}
}
just call it like this:
//call getMousePickingNode everytime you do a mouseclick, it will then return the node under the mouse cursor. if there is no node under the mousecursor, it will return always 0.
ISceneNode* node = getMousePickingNode();
//which will mean, if there is no node under the cursor when you execute the command above, node is 0.
you could then do something like this:
Code: Select all
//if node is 0, the app will crash, so thats why we check if the node exist
if(node)
{
// display a window with entity statistics (you have to code it yourself, just an example, syntax is "setEntityWindow(ISceneNode* Node, bool visible)")
yourguifunction->setEntityWindow(node, true);
}
you get what i mean?
and if you do not want to create the nodes yourself, do it like this:
Code: Select all
//this is called an array
IAnimatedMeshSceneNode* nodes[10];
for(int x = 0; x < 10; ++x)
{
nodes[x] = SceneManager->addAnimatedMeshSceneNode(yourmesh);
nodes[x]->setPosition(vector3df(0.0f*x, 0.0f*x, 0.0f*x));
}
i hope this could help