Class BillboardParticleBatch
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch<BillboardControllerRenderData>
-
- com.badlogic.gdx.graphics.g3d.particles.batches.BillboardParticleBatch
-
- All Implemented Interfaces:
ParticleBatch<BillboardControllerRenderData>,ResourceData.Configurable,RenderableProvider
public class BillboardParticleBatch extends BufferedParticleBatch<BillboardControllerRenderData>
This class is used to render billboard particles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBillboardParticleBatch.Config
-
Field Summary
Fields Modifier and Type Field Description protected BlendingAttributeblendingAttributeprotected DepthTestAttributedepthTestAttributeprotected static intdirectionUsageprotected ParticleShader.AlignModemodeprotected static intsizeAndRotationUsageprotected Texturetextureprotected static Matrix3TMP_M3protected static Vector3TMP_V1protected static Vector3TMP_V2protected static Vector3TMP_V3protected static Vector3TMP_V4protected static Vector3TMP_V5protected static Vector3TMP_V6protected booleanuseGPU-
Fields inherited from class com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch
bufferedParticlesCount, camera, currentCapacity, renderData, sorter
-
-
Constructor Summary
Constructors Constructor Description BillboardParticleBatch()BillboardParticleBatch(int capacity)BillboardParticleBatch(ParticleShader.AlignMode mode, boolean useGPU, int capacity)BillboardParticleBatch(ParticleShader.AlignMode mode, boolean useGPU, int capacity, BlendingAttribute blendingAttribute, DepthTestAttribute depthTestAttribute)Create a new BillboardParticleBatch
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallocParticlesData(int capacity)protected RenderableallocRenderable()voidbegin()Must be called once before any drawing operationprotected voidflush(int[] offsets)Sends the data to the gpu.ParticleShader.AlignModegetAlignMode()BlendingAttributegetBlendingAttribute()voidgetRenderables(Array<Renderable> renderables, Pool<Renderable> pool)ReturnsRenderableinstances.protected ShadergetShader(Renderable renderable)TexturegetTexture()booleanisUseGPU()voidload(AssetManager manager, ResourceData resources)voidsave(AssetManager manager, ResourceData resources)voidsetAlignMode(ParticleShader.AlignMode mode)Sets the current align mode.voidsetTexture(Texture texture)voidsetUseGpu(boolean useGPU)Sets the current align mode.voidsetVertexData()Sets vertex attributes and size-
Methods inherited from class com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch
draw, end, ensureCapacity, getBufferedCount, getSorter, resetCapacity, setCamera, setSorter
-
-
-
-
Field Detail
-
TMP_V1
protected static final Vector3 TMP_V1
-
TMP_V2
protected static final Vector3 TMP_V2
-
TMP_V3
protected static final Vector3 TMP_V3
-
TMP_V4
protected static final Vector3 TMP_V4
-
TMP_V5
protected static final Vector3 TMP_V5
-
TMP_V6
protected static final Vector3 TMP_V6
-
TMP_M3
protected static final Matrix3 TMP_M3
-
sizeAndRotationUsage
protected static final int sizeAndRotationUsage
- See Also:
- Constant Field Values
-
directionUsage
protected static final int directionUsage
- See Also:
- Constant Field Values
-
useGPU
protected boolean useGPU
-
mode
protected ParticleShader.AlignMode mode
-
texture
protected Texture texture
-
blendingAttribute
protected BlendingAttribute blendingAttribute
-
depthTestAttribute
protected DepthTestAttribute depthTestAttribute
-
-
Constructor Detail
-
BillboardParticleBatch
public BillboardParticleBatch(ParticleShader.AlignMode mode, boolean useGPU, int capacity, BlendingAttribute blendingAttribute, DepthTestAttribute depthTestAttribute)
Create a new BillboardParticleBatch- Parameters:
mode-useGPU- Allow to use GPU instead of CPUcapacity- Max particle displayedblendingAttribute- Blending attribute used by the batchdepthTestAttribute- DepthTest attribute used by the batch
-
BillboardParticleBatch
public BillboardParticleBatch(ParticleShader.AlignMode mode, boolean useGPU, int capacity)
-
BillboardParticleBatch
public BillboardParticleBatch()
-
BillboardParticleBatch
public BillboardParticleBatch(int capacity)
-
-
Method Detail
-
allocParticlesData
public void allocParticlesData(int capacity)
- Specified by:
allocParticlesDatain classBufferedParticleBatch<BillboardControllerRenderData>
-
allocRenderable
protected Renderable allocRenderable()
-
getShader
protected Shader getShader(Renderable renderable)
-
setVertexData
public void setVertexData()
Sets vertex attributes and size
-
setAlignMode
public void setAlignMode(ParticleShader.AlignMode mode)
Sets the current align mode. It will reallocate internal data, use only when necessary.
-
getAlignMode
public ParticleShader.AlignMode getAlignMode()
-
setUseGpu
public void setUseGpu(boolean useGPU)
Sets the current align mode. It will reallocate internal data, use only when necessary.
-
isUseGPU
public boolean isUseGPU()
-
setTexture
public void setTexture(Texture texture)
-
getTexture
public Texture getTexture()
-
getBlendingAttribute
public BlendingAttribute getBlendingAttribute()
-
begin
public void begin()
Description copied from interface:ParticleBatchMust be called once before any drawing operation- Specified by:
beginin interfaceParticleBatch<BillboardControllerRenderData>- Overrides:
beginin classBufferedParticleBatch<BillboardControllerRenderData>
-
flush
protected void flush(int[] offsets)
Description copied from class:BufferedParticleBatchSends 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:
flushin classBufferedParticleBatch<BillboardControllerRenderData>- Parameters:
offsets- the calculated offsets
-
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.- 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)
-
-