Author Topic: Removing lights in JPCT-AE  (Read 1070 times)

Offline vickt

  • byte
  • *
  • Posts: 9
    • View Profile
Removing lights in JPCT-AE
« 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Removing lights in JPCT-AE
« Reply #1 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