Node.collideWith() question

In case it matters and you are interested, Lemur has scene picking build in. You just add listeners to whatever node/geometry you like and you will get notified.

Deeper old example here: Lemur Gems #3 : Scene picking

…but the short version is:

MouseEventControl.addListenersToSpatial(node, new DefaultMouseListener() {
        protected void click( MouseButtonEvent event, Spatial target, Spatial capture ) {
            // do the stuff
        }
    });

Then whenever the mouse clicks on ‘node’, the click method is called.

Edit: also note that you can use the scene picking even if you don’t use the rest of Lemur for your UI or anything.

3 Likes