rootNode Light Sources

Dear jMonkeys





I’m working on a scene, where I would like to toggle light sources per key input. So when some key is pressed, some lights are being detached from the rootNode and some are attached.

Now to know in which state I am (which lights are attached, which ones are not), I have to set some variable, then read and alter it, whenever that key is pressed. It would be more comfortable, if one could get a list of light sources back from the rootNode, just like you can get its children or the processors from a viewPort. That way I could find out which lights are currently attached and by that know, which ones I would have to attach/detach.



I once already requested a minor add-on to he API, which is - to my knowledge - not implemented until now. It was this one.

I know these changes are unimportant compared to the other work you are doing on the engine. I just wanted to have it mentioned.





Best regards

Meral Harbes

If you have all the lights on the root node you can call rootNode.getLocalLightList() to get all of the lights. Then attach/detach them from that.

Currently there is no way to dig down and get all child lights, however you can look up from a child node and get all parent lights that affect it.



As for your other request, sometimes things just get lost. You aren’t being ignored :slight_smile:

Now that beta is out we can add a few more, minor, tweaks to the API. Just keep bugging us and it will get in eventually :wink: You can also supply a patch with the changes, makes it easier and quicker for us to get it in.

Posting diff patch increases chances of it getting added