Class ParticleSorter.Distance

  • Enclosing class:
    ParticleSorter

    public static class ParticleSorter.Distance
    extends ParticleSorter
    This class will sort all the particles using the distance from camera.
    • Constructor Detail

      • Distance

        public Distance()
    • Method Detail

      • ensureCapacity

        public void ensureCapacity​(int capacity)
        Description copied from class: ParticleSorter
        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)
        Overrides:
        ensureCapacity in class ParticleSorter
      • sort

        public <T extends ParticleControllerRenderData> int[] sort​(Array<T> renderData)
        Specified by:
        sort in class ParticleSorter
        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).
      • qsort

        public void qsort​(int si,
                          int ei)