How to check mouse?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

How to check mouse?

Post by Guest »

if i write customscenenode ,i want to know how to detect which
customscenenode is on ( or click ) , how can i know?
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

I'm toying with this one myself. You can do:

Code: Select all

scene::ISceneNode* node1;
scene::ISceneNode* node2;

// Do some collision from screen coords ( check API for collision manager )

if (node1)
{
       // Node 1 was selected
}

if (node2)
{
      // Node 2 was selected
}
However, if you want to know if it was a certain group of nodes ( such as a bunch of custom scene nodes ) then just entering ICustomSceneNode ( or whatever you called it ) instead of a pointer to a specific node won't work. What you want to do is to create a dummy scene node ( IDummyTransformationSceneNode I think ) that is the parent of this group of nodes.

The problem is you need to get the parent from the node and there isn't any getParent() function for scene nodes. You could add it to your node, just have it return the protected parent pointer from your constructor.
Post Reply