Author Topic: Removing lights in JPCT-AE  (Read 1444 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: 12047
    • View Profile
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: