Class ParticleSorter

java.lang.Object
com.badlogic.gdx.graphics.g3d.particles.ParticleSorter
Direct Known Subclasses:
ParticleSorter.Distance, ParticleSorter.None

public abstract class ParticleSorter extends Object
This class is used by particle batches to sort the particles before rendering.
  • Field Details

    • camera

      protected Camera camera
  • Constructor Details

    • ParticleSorter

      public ParticleSorter()
  • Method Details

    • sort

      public abstract <T extends ParticleControllerRenderData> int[] sort(Array<T> renderData)
      Returns:
      an array of offsets where each particle should be put in the resulting mesh (also if more than one mesh will be generated, this is an absolute offset considering a BIG output array).
    • setCamera

      public void setCamera(Camera camera)
    • ensureCapacity

      public void ensureCapacity(int capacity)
      This method is called when the batch has increased the underlying particle buffer. In this way the sorter can increase the data structures used to sort the particles (i.e increase backing array size)