Class BufferedParticleBatch<T extends ParticleControllerRenderData>
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch<T>
-
- All Implemented Interfaces:
ParticleBatch<T>,ResourceData.Configurable,RenderableProvider
- Direct Known Subclasses:
BillboardParticleBatch,PointSpriteParticleBatch
public abstract class BufferedParticleBatch<T extends ParticleControllerRenderData> extends java.lang.Object implements ParticleBatch<T>
Base class of all the batches requiring to bufferParticleControllerRenderData
-
-
Field Summary
Fields Modifier and Type Field Description protected intbufferedParticlesCountprotected Cameracameraprotected intcurrentCapacityprotected Array<T>renderDataprotected ParticleSortersorter
-
Constructor Summary
Constructors Modifier Constructor Description protectedBufferedParticleBatch(java.lang.Class<T> type)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidallocParticlesData(int capacity)voidbegin()Must be called once before any drawing operationvoiddraw(T data)voidend()Must be called after all the drawing operationsvoidensureCapacity(int capacity)Ensure the batch can contain the passed in amount of particlesprotected abstract voidflush(int[] offsets)Sends the data to the gpu.intgetBufferedCount()ParticleSortergetSorter()voidresetCapacity()voidsetCamera(Camera camera)voidsetSorter(ParticleSorter sorter)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.badlogic.gdx.graphics.g3d.particles.batches.ParticleBatch
load, save
-
Methods inherited from interface com.badlogic.gdx.graphics.g3d.RenderableProvider
getRenderables
-
-
-
-
Field Detail
-
renderData
protected Array<T extends ParticleControllerRenderData> renderData
-
bufferedParticlesCount
protected int bufferedParticlesCount
-
currentCapacity
protected int currentCapacity
-
sorter
protected ParticleSorter sorter
-
camera
protected Camera camera
-
-
Constructor Detail
-
BufferedParticleBatch
protected BufferedParticleBatch(java.lang.Class<T> type)
-
-
Method Detail
-
begin
public void begin()
Description copied from interface:ParticleBatchMust be called once before any drawing operation- Specified by:
beginin interfaceParticleBatch<T extends ParticleControllerRenderData>
-
draw
public void draw(T data)
- Specified by:
drawin interfaceParticleBatch<T extends ParticleControllerRenderData>
-
end
public void end()
Description copied from interface:ParticleBatchMust be called after all the drawing operations- Specified by:
endin interfaceParticleBatch<T extends ParticleControllerRenderData>
-
ensureCapacity
public void ensureCapacity(int capacity)
Ensure the batch can contain the passed in amount of particles
-
resetCapacity
public void resetCapacity()
-
allocParticlesData
protected abstract void allocParticlesData(int capacity)
-
setCamera
public void setCamera(Camera camera)
-
getSorter
public ParticleSorter getSorter()
-
setSorter
public void setSorter(ParticleSorter sorter)
-
flush
protected abstract void flush(int[] offsets)
Sends the data to the gpu. This method must use the calculated offsets to build the particles meshes. The offsets represent the position at which a particle should be placed into the vertex array.- Parameters:
offsets- the calculated offsets
-
getBufferedCount
public int getBufferedCount()
-
-