public abstract class BufferedParticleBatch<T extends ParticleControllerRenderData> extends java.lang.Object implements ParticleBatch<T>
ParticleControllerRenderData
Modifier and Type | Field and Description |
---|---|
protected int |
bufferedParticlesCount |
protected Camera |
camera |
protected int |
currentCapacity |
protected Array<T> |
renderData |
protected ParticleSorter |
sorter |
Modifier | Constructor and Description |
---|---|
protected |
BufferedParticleBatch(java.lang.Class<T> type) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
allocParticlesData(int capacity) |
void |
begin()
Must be called once before any drawing operation
|
void |
draw(T data) |
void |
end()
Must be called after all the drawing operations
|
void |
ensureCapacity(int capacity)
Ensure the batch can contain the passed in amount of particles
|
protected abstract void |
flush(int[] offsets)
Sends the data to the gpu.
|
int |
getBufferedCount() |
ParticleSorter |
getSorter() |
void |
resetCapacity() |
void |
setCamera(Camera camera) |
void |
setSorter(ParticleSorter sorter) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
load, save
getRenderables
protected Array<T extends ParticleControllerRenderData> renderData
protected int bufferedParticlesCount
protected int currentCapacity
protected ParticleSorter sorter
protected Camera camera
protected BufferedParticleBatch(java.lang.Class<T> type)
public void begin()
ParticleBatch
begin
in interface ParticleBatch<T extends ParticleControllerRenderData>
public void draw(T data)
draw
in interface ParticleBatch<T extends ParticleControllerRenderData>
public void end()
ParticleBatch
end
in interface ParticleBatch<T extends ParticleControllerRenderData>
public void ensureCapacity(int capacity)
public void resetCapacity()
protected abstract void allocParticlesData(int capacity)
public void setCamera(Camera camera)
public ParticleSorter getSorter()
public void setSorter(ParticleSorter sorter)
protected abstract void flush(int[] offsets)
offsets
- the calculated offsetspublic int getBufferedCount()