worldLightList + feature request

I have two questions:
1: Does the getWorldLightList() - method return ALL lights from a node? (like all Lights from all children) or just from the first “layer”?
2: I already asked that months ago but didn’t get any answer; I’m really glad to give some values to spatials via the setUserData() - method.
But I’d also find it really useful to be able to do that with Lights, Materials and Filters. Is there any specific reason why these Objects don’t have the UserData hasmap?
Or could you implement this?


  1. Actually that’s the other way around. It returns all lights affecting this node, meaning local lights of the node and all the lights of its parents.
  2. mhh user data on lights, materials and filters. Idk… Could you give a usage example?
1 Like

Thank you for answering.

Usage Example:
For instance when the player itself is a PointLight (yeah, it’s a little weird).
So you do not want / need a player - Spatial for that game, but that means that you
a) Create a Player - class just to store some data
b) Store the player data in the SimpleApplication itself
c) Create a Spatial to store the data in even though you don’t need it
I’d rather like to just put playerLight.setUserData(“whatever”, whatever);

Or you want a WaterFilter to be able to be ‘poisoned’, so everytime the player does something like ‘poison’ it the userData named ‘poison’ would increase and at a certain value start to change the color of the water. Or the water damages the player as he has contact with it and subtracts the userData ‘damage’ from the players (maybe still a PointLight :slight_smile: ) userData ‘life’

So these are some examples…

I hope they are convincing :slight_smile:

Game objects are not the same as scene graph objects and it’s wrong to encourage them to blend so closely. JME already does this too much in my opinion… not so much in how the code is written but in our examples (because they are simple).

You actually should have a player object since you have a player object. The fact that the player is also a light is an implementation detail of your visualization. You will be much happier in the long run if you break the bad habit of trying to make them the same thing.

1 Like

What @pspeed said :smiley:

Ok, gonna do it that way I guess :slight_smile:
Thanks for the answers!