Light won't go away

Hi everyone :slight_smile:



I have a scene with a lightstate.

Attached to the scene is a Node (plus model) that has a SimpleLightNode with a pointlight attached to it.

(Meaning quite simple: i have a model carrying a light with it)





Then I detach the Model Node from the scene. It's then gone. As intended.

As consequence, the SimpleLightNode should be detached from the scene as well, has it is no longer part of the scene graph.



Now the problem:

The light still shines the scene.



What am i doing wrong?



Do i have do explicitly detach the pointlight from the lightstate?

Problem with that would be to keep an extra superflous reference for every light, because the SimpleLightNode class provides no getLight() methode or something.

Would be pretty complicated, imho.



Or do i only have to call some kind of update…() somwhere to make the LightState or the LightNode or whatever realize that the light is actually gone?



Or something else?





Thx for any help

did you call updateRenderStates() on the model after removing the light?

i called updateRenderState() on the model, on it's parent node and the node for the map (on which the light can still be seen).

i updated almost everything, still there's this light from the detached lightnode.



:frowning:



I'm sure i just missed something, but i don't know what…

Paigan said:

Do i have do explicitly detach the pointlight from the lightstate?

Yes! You have attached it there, haven't you?


SimpleLightNode class provides no getLight() methode or something

It has one now :)