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

public final Class ParticleSystem

extends Object
implements RenderableProvider
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.graphics.g3d.RenderableProvider
Imports
com.badlogic.gdx.graphics.g3d.Renderable, .RenderableProvider, com.badlogic.gdx.graphics.g3d.particles.batches.ParticleBatch, com.badlogic.gdx.utils.Array, .Pool

Singleton class which manages the particle effects. It's a utility class to ease particle batches management and particle effects update.
Author
inferno

Field Summary

Modifier and TypeField and Description
private Array<ParticleBatch<?>>
private Array<ParticleEffect>
private static ParticleSystem

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(ParticleBatch<?> batch)

public void
public void
begin()

Must be called one time per frame before any particle effect drawing operation will occur.

public void
draw()

Draws all the particle effects.

public void
end()

Must be called one time per frame at the end of all drawing operations.

public static ParticleSystem
get()
Deprecated Please directly use the constructor

public Array<ParticleBatch<?>>
public void
public void
public void
removeAll()

Removes all the effects added to the system

public void
update()

Updates the simulation of all effects

public void
update(float deltaTime)

public void
public void
updateAndDraw(float deltaTime)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

batchesback to summary
private Array<ParticleBatch<?>> batches
effectsback to summary
private Array<ParticleEffect> effects
instanceback to summary
private static ParticleSystem instance

Constructor Detail

ParticleSystemback to summary
public ParticleSystem()

Method Detail

addback to summary
public void add(ParticleBatch<?> batch)
addback to summary
public void add(ParticleEffect effect)
beginback to summary
public void begin()

Must be called one time per frame before any particle effect drawing operation will occur.

drawback to summary
public void draw()

Draws all the particle effects. Call begin() before this method and end() after.

endback to summary
public void end()

Must be called one time per frame at the end of all drawing operations.

getback to summary
public static ParticleSystem get()

Deprecated

Please directly use the constructor

Annotations
@Deprecated
getBatchesback to summary
public Array<ParticleBatch<?>> getBatches()
getRenderablesback to summary
public void getRenderables(Array<Renderable> renderables, Pool<Renderable> pool)

Implements com.badlogic.gdx.graphics.g3d.RenderableProvider.getRenderables.

Doc from com.badlogic.gdx.graphics.g3d.RenderableProvider.getRenderables.

Returns Renderable instances. Renderables are obtained from the provided Pool and added to the provided array. The Renderables obtained using Pool#obtain() will later be put back into the pool, do not store them internally. The resulting array can be rendered via a ModelBatch.

Annotations
@Override
removeback to summary
public void remove(ParticleEffect effect)
removeAllback to summary
public void removeAll()

Removes all the effects added to the system

updateback to summary
public void update()

Updates the simulation of all effects

updateback to summary
public void update(float deltaTime)
updateAndDrawback to summary
public void updateAndDraw()
updateAndDrawback to summary
public void updateAndDraw(float deltaTime)