Class ParticleSorter
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.particles.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParticleSorter.Distance
This class will sort all the particles using the distance from camera.static class
ParticleSorter.None
Using this class will not apply sorting
-
Constructor Summary
Constructors Constructor Description ParticleSorter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
ensureCapacity(int capacity)
This method is called when the batch has increased the underlying particle buffer.void
setCamera(Camera camera)
abstract <T extends ParticleControllerRenderData>
int[]sort(Array<T> renderData)
-
-
-
Field Detail
-
camera
protected Camera camera
-
-
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)
-
-