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 void
add(ParticleBatch<?> batch)
void
add(ParticleEffect effect)
void
begin()
Must be called one time per frame before any particle effect drawing operation will occur.void
draw()
Draws all the particle effects.void
end()
Must be called one time per frame at the end of all drawing operations.static ParticleSystem
get()
Deprecated.Please directly use the constructorArray<ParticleBatch<?>>
getBatches()
void
getRenderables(Array<Renderable> renderables, Pool<Renderable> pool)
ReturnsRenderable
instances.void
remove(ParticleEffect effect)
void
removeAll()
Removes all the effects added to the systemvoid
update()
Updates the simulation of all effectsvoid
update(float deltaTime)
void
updateAndDraw()
void
updateAndDraw(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:RenderableProvider
ReturnsRenderable
instances. Renderables are obtained from the providedPool
and 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:
getRenderables
in interfaceRenderableProvider
- Parameters:
renderables
- the output arraypool
- the pool to obtain Renderables from
-
getBatches
public Array<ParticleBatch<?>> getBatches()
-
-