Class PointSpriteParticleBatch
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch<PointSpriteControllerRenderData>
-
- com.badlogic.gdx.graphics.g3d.particles.batches.PointSpriteParticleBatch
-
- All Implemented Interfaces:
ParticleBatch<PointSpriteControllerRenderData>
,ResourceData.Configurable
,RenderableProvider
public class PointSpriteParticleBatch extends BufferedParticleBatch<PointSpriteControllerRenderData>
This class is used to draw particles as point sprites.
-
-
Field Summary
Fields Modifier and Type Field Description protected BlendingAttribute
blendingAttribute
protected static VertexAttributes
CPU_ATTRIBUTES
protected static int
CPU_COLOR_OFFSET
protected static int
CPU_POSITION_OFFSET
protected static int
CPU_REGION_OFFSET
protected static int
CPU_SIZE_AND_ROTATION_OFFSET
protected static int
CPU_VERTEX_SIZE
protected DepthTestAttribute
depthTestAttribute
protected static int
sizeAndRotationUsage
protected static Vector3
TMP_V1
-
Fields inherited from class com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch
bufferedParticlesCount, camera, currentCapacity, renderData, sorter
-
-
Constructor Summary
Constructors Constructor Description PointSpriteParticleBatch()
PointSpriteParticleBatch(int capacity)
PointSpriteParticleBatch(int capacity, ParticleShader.Config shaderConfig)
PointSpriteParticleBatch(int capacity, ParticleShader.Config shaderConfig, BlendingAttribute blendingAttribute, DepthTestAttribute depthTestAttribute)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
allocParticlesData(int capacity)
protected void
allocRenderable()
protected void
flush(int[] offsets)
Sends the data to the gpu.BlendingAttribute
getBlendingAttribute()
void
getRenderables(Array<Renderable> renderables, Pool<Renderable> pool)
ReturnsRenderable
instances.Texture
getTexture()
void
load(AssetManager manager, ResourceData resources)
void
save(AssetManager manager, ResourceData resources)
void
setTexture(Texture texture)
-
Methods inherited from class com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch
begin, draw, end, ensureCapacity, getBufferedCount, getSorter, resetCapacity, setCamera, setSorter
-
-
-
-
Field Detail
-
TMP_V1
protected static final Vector3 TMP_V1
-
sizeAndRotationUsage
protected static final int sizeAndRotationUsage
- See Also:
- Constant Field Values
-
CPU_ATTRIBUTES
protected static final VertexAttributes CPU_ATTRIBUTES
-
CPU_VERTEX_SIZE
protected static final int CPU_VERTEX_SIZE
-
CPU_POSITION_OFFSET
protected static final int CPU_POSITION_OFFSET
-
CPU_COLOR_OFFSET
protected static final int CPU_COLOR_OFFSET
-
CPU_REGION_OFFSET
protected static final int CPU_REGION_OFFSET
-
CPU_SIZE_AND_ROTATION_OFFSET
protected static final int CPU_SIZE_AND_ROTATION_OFFSET
-
blendingAttribute
protected BlendingAttribute blendingAttribute
-
depthTestAttribute
protected DepthTestAttribute depthTestAttribute
-
-
Constructor Detail
-
PointSpriteParticleBatch
public PointSpriteParticleBatch()
-
PointSpriteParticleBatch
public PointSpriteParticleBatch(int capacity)
-
PointSpriteParticleBatch
public PointSpriteParticleBatch(int capacity, ParticleShader.Config shaderConfig)
-
PointSpriteParticleBatch
public PointSpriteParticleBatch(int capacity, ParticleShader.Config shaderConfig, BlendingAttribute blendingAttribute, DepthTestAttribute depthTestAttribute)
-
-
Method Detail
-
allocParticlesData
protected void allocParticlesData(int capacity)
- Specified by:
allocParticlesData
in classBufferedParticleBatch<PointSpriteControllerRenderData>
-
allocRenderable
protected void allocRenderable()
-
setTexture
public void setTexture(Texture texture)
-
getTexture
public Texture getTexture()
-
getBlendingAttribute
public BlendingAttribute getBlendingAttribute()
-
flush
protected void flush(int[] offsets)
Description copied from class:BufferedParticleBatch
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.- Specified by:
flush
in classBufferedParticleBatch<PointSpriteControllerRenderData>
- Parameters:
offsets
- the calculated offsets
-
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
.- Parameters:
renderables
- the output arraypool
- the pool to obtain Renderables from
-
save
public void save(AssetManager manager, ResourceData resources)
-
load
public void load(AssetManager manager, ResourceData resources)
-
-