Class ParticleSorter

  • Direct Known Subclasses:
    ParticleSorter.Distance, ParticleSorter.None

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

      • camera

        protected Camera camera
    • Constructor Detail

      • ParticleSorter

        public ParticleSorter()
    • Method Detail

      • 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)