APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.graphics.g3d.particles

public abstract Class ParticleSorter

extends Object
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.None, com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.Distance
Imports
com.badlogic.gdx.graphics.Camera, com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerRenderData, com.badlogic.gdx.math.Matrix4, .Vector3, com.badlogic.gdx.utils.Array

This class is used by particle batches to sort the particles before rendering.
Author
Inferno

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ParticleSorter.Distance

This class will sort all the particles using the distance from camera.

public static class
ParticleSorter.None

Using this class will not apply sorting

Field Summary

Modifier and TypeField and Description
protected Camera
pack-priv static final Vector3

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
ensureCapacity(int capacity)

This method is called when the batch has increased the underlying particle buffer.

public void
setCamera(Camera camera)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cameraback to summary
protected Camera camera
TMP_V1back to summary
pack-priv static final Vector3 TMP_V1

Constructor Detail

ParticleSorterback to summary
public ParticleSorter()

Method Detail

ensureCapacityback to summary
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)

setCameraback to summary
public void setCamera(Camera camera)
sortback to summary
public abstract <T extends ParticleControllerRenderData> int[] sort(Array<T> renderData)
Returns:int[]

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

com.badlogic.gdx.graphics.g3d.particles back to summary

public Class ParticleSorter.Distance

extends ParticleSorter
Class Inheritance

This class will sort all the particles using the distance from camera.

Field Summary

Modifier and TypeField and Description
private int
private float[]
private int[]
private int[]
Inherited from com.badlogic.gdx.graphics.g3d.particles.ParticleSorter:
cameraTMP_V1

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
ensureCapacity(int capacity)

Overrides com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.ensureCapacity.

This method is called when the batch has increased the underlying particle buffer.

public void
qsort(int si, int ei)

public <T extends ParticleControllerRenderData> int[]
Inherited from com.badlogic.gdx.graphics.g3d.particles.ParticleSorter:
setCamera

Field Detail

currentSizeback to summary
private int currentSize
distancesback to summary
private float[] distances
particleIndicesback to summary
private int[] particleIndices
particleOffsetsback to summary
private int[] particleOffsets

Constructor Detail

Distanceback to summary
public Distance()

Method Detail

ensureCapacityback to summary
public void ensureCapacity(int capacity)

Overrides com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.ensureCapacity.

Doc from com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.ensureCapacity.

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)

Annotations
@Override
qsortback to summary
public void qsort(int si, int ei)
sortback to summary
public <T extends ParticleControllerRenderData> int[] sort(Array<T> renderData)

Implements abstract com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.sort.

Annotations
@Override
com.badlogic.gdx.graphics.g3d.particles back to summary

public Class ParticleSorter.None

extends ParticleSorter
Class Inheritance

Using this class will not apply sorting

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int[]
Inherited from com.badlogic.gdx.graphics.g3d.particles.ParticleSorter:
cameraTMP_V1

Constructor Summary

AccessConstructor and Description
public
None()

Method Summary

Modifier and TypeMethod and Description
public void
ensureCapacity(int capacity)

Overrides com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.ensureCapacity.

This method is called when the batch has increased the underlying particle buffer.

public <T extends ParticleControllerRenderData> int[]
Inherited from com.badlogic.gdx.graphics.g3d.particles.ParticleSorter:
setCamera

Field Detail

currentCapacityback to summary
pack-priv int currentCapacity
indicesback to summary
pack-priv int[] indices

Constructor Detail

Noneback to summary
public None()

Method Detail

ensureCapacityback to summary
public void ensureCapacity(int capacity)

Overrides com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.ensureCapacity.

Doc from com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.ensureCapacity.

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)

Annotations
@Override
sortback to summary
public <T extends ParticleControllerRenderData> int[] sort(Array<T> renderData)

Implements abstract com.badlogic.gdx.graphics.g3d.particles.ParticleSorter.sort.

Annotations
@Override