Removing lights in JPCT-AE

Started by vickt, April 30, 2012, 03:12:30 AM

Previous topic - Next topic

vickt

For my explosion and muzzle flare effects I'm adding lights to the world for a set number of frames and then I'm calling light.disable() on them. This works about the first six times, but then the lights fail to show up anymore.

Is there a limit on the number of lights that a World can contain in JPCT-AE, and if so what is a better way to remove lights than calling disable()? JPCT-AE's implementation of World does not allow to remove lights by ID.

EgonOlsen

The best approach is to use a light pool.
This thread has more Info as well as a basic implementation of a light pool: http://www.jpct.net/forum2/index.php?topic=1288.0