Class ParticleSystem
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.particles.ParticleSystem
-
- All Implemented Interfaces:
RenderableProvider
public final class ParticleSystem extends java.lang.Object implements RenderableProvider
Singleton class which manages the particle effects. It's a utility class to ease particle batches management and particle effects update.
-
-
Constructor Summary
Constructors Constructor Description ParticleSystem()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(ParticleBatch<?> batch)voidadd(ParticleEffect effect)voidbegin()Must be called one time per frame before any particle effect drawing operation will occur.voiddraw()Draws all the particle effects.voidend()Must be called one time per frame at the end of all drawing operations.static ParticleSystemget()Deprecated.Please directly use the constructorArray<ParticleBatch<?>>getBatches()voidgetRenderables(Array<Renderable> renderables, Pool<Renderable> pool)ReturnsRenderableinstances.voidremove(ParticleEffect effect)voidremoveAll()Removes all the effects added to the systemvoidupdate()Updates the simulation of all effectsvoidupdate(float deltaTime)voidupdateAndDraw()voidupdateAndDraw(float deltaTime)
-
-
-
Method Detail
-
get
@Deprecated public static ParticleSystem get()
Deprecated.Please directly use the constructor
-
add
public void add(ParticleBatch<?> batch)
-
add
public void add(ParticleEffect effect)
-
remove
public void remove(ParticleEffect effect)
-
removeAll
public void removeAll()
Removes all the effects added to the system
-
update
public void update()
Updates the simulation of all effects
-
updateAndDraw
public void updateAndDraw()
-
update
public void update(float deltaTime)
-
updateAndDraw
public void updateAndDraw(float deltaTime)
-
begin
public void begin()
Must be called one time per frame before any particle effect drawing operation will occur.
-
draw
public void draw()
-
end
public void end()
Must be called one time per frame at the end of all drawing operations.
-
getRenderables
public void getRenderables(Array<Renderable> renderables, Pool<Renderable> pool)
Description copied from interface:RenderableProviderReturnsRenderableinstances. Renderables are obtained from the providedPooland added to the provided array. The Renderables obtained usingPool.obtain()will later be put back into the pool, do not store them internally. The resulting array can be rendered via aModelBatch.- Specified by:
getRenderablesin interfaceRenderableProvider- Parameters:
renderables- the output arraypool- the pool to obtain Renderables from
-
getBatches
public Array<ParticleBatch<?>> getBatches()
-
-