www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: vickt on April 30, 2012, 03:12:30 am

Title: Removing lights in JPCT-AE
Post by: vickt on April 30, 2012, 03:12:30 am
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.
Title: Re: Removing lights in JPCT-AE
Post by: EgonOlsen on April 30, 2012, 08:25:28 am
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 (http://www.jpct.net/forum2/index.php?topic=1288.0)