APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.graphics.g3d.particles.batches

public Class BillboardParticleBatch

extends BufferedParticleBatch<BillboardControllerRenderData>
Class Inheritance
Imports
com.badlogic.gdx.assets.AssetManager, com.badlogic.gdx.graphics.GL20, .Mesh, .Texture, .VertexAttribute, .VertexAttributes, .VertexAttributes.Usage, com.badlogic.gdx.graphics.g3d.Material, .Renderable, .Shader, com.badlogic.gdx.graphics.g3d.attributes.BlendingAttribute, .DepthTestAttribute, .TextureAttribute, com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel, .ParticleChannels, .ParticleShader, .ParticleShader.AlignMode, .ResourceData, .ResourceData.SaveData, com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardControllerRenderData, com.badlogic.gdx.graphics.g3d.shaders.DefaultShader, com.badlogic.gdx.graphics.glutils.ShaderProgram, com.badlogic.gdx.math.MathUtils, .Matrix3, .Vector3, com.badlogic.gdx.utils.Array, .Pool

This class is used to render billboard particles.
Author
Inferno

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private class

Field Summary

Modifier and TypeField and Description
protected BlendingAttribute
private static final VertexAttributes
private static final int
private static final int
private static final int
private static final int
private VertexAttributes
private int
protected DepthTestAttribute
protected static final int
private static final VertexAttributes
private static final int
private static final int
private static final int
private static final int
private static final int
private short[]
private static final int
private static final int
protected ParticleShader.AlignMode
private BillboardParticleBatch.RenderablePool
private Array<Renderable>
pack-priv Shader
protected static final int
protected Texture
protected static final Matrix3
protected static final Vector3
protected static final Vector3
protected static final Vector3
protected static final Vector3
protected static final Vector3
protected static final Vector3
protected boolean
private float[]
Inherited from com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch:
bufferedParticlesCountcameracurrentCapacityrenderDatasorter

Constructor Summary

AccessConstructor and Description
public
BillboardParticleBatch(ParticleShader.AlignMode mode, boolean
Allow to use GPU instead of CPU
useGPU
,
int
Max particle displayed
capacity
,
BlendingAttribute
Blending attribute used by the batch
blendingAttribute
,
DepthTestAttribute
DepthTest attribute used by the batch
depthTestAttribute
)

Create a new BillboardParticleBatch

public
BillboardParticleBatch(ParticleShader.AlignMode mode, boolean useGPU, int capacity)

public
public
BillboardParticleBatch(int capacity)

Method Summary

Modifier and TypeMethod and Description
private void
public void
protected Renderable
private void
allocRenderables(int capacity)

private void
public void
private void
private void
fillVerticesGPU(int[] particlesOffset)

private void
fillVerticesToScreenCPU(int[] particlesOffset)

private void
fillVerticesToViewPointCPU(int[] particlesOffset)

protected void
flush(int[] offsets)

Implements abstract com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch.flush.

Sends the data to the gpu.

public ParticleShader.AlignMode
public BlendingAttribute
public void
protected Shader
getShader(Renderable renderable)

public Texture
private void
initRenderData()

Allocates all the require rendering resources like Renderables,Shaders,Meshes according to the current batch configuration.

public boolean
public void
private static void
putVertex(float[] vertices, int offset, float x, float y, float z, float u, float v, float scaleX, float scaleY, float cosRotation, float sinRotation, float r, float g, float b, float a)

private static void
putVertex(float[] vertices, int offset, Vector3 p, float u, float v, float r, float g, float b, float a)

public void
public void
setAlignMode(ParticleShader.AlignMode mode)

Sets the current align mode.

public void
public void
setUseGpu(boolean useGPU)

Sets the current align mode.

public void
setVertexData()

Sets vertex attributes and size

Inherited from com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch:
drawendensureCapacitygetBufferedCountgetSorterresetCapacitysetCamerasetSorter

Field Detail

blendingAttributeback to summary
protected BlendingAttribute blendingAttribute
CPU_ATTRIBUTESback to summary
private static final VertexAttributes CPU_ATTRIBUTES
CPU_COLOR_OFFSETback to summary
private static final int CPU_COLOR_OFFSET
CPU_POSITION_OFFSETback to summary
private static final int CPU_POSITION_OFFSET
CPU_UV_OFFSETback to summary
private static final int CPU_UV_OFFSET
CPU_VERTEX_SIZEback to summary
private static final int CPU_VERTEX_SIZE
currentAttributesback to summary
private VertexAttributes currentAttributes
currentVertexSizeback to summary
private int currentVertexSize
depthTestAttributeback to summary
protected DepthTestAttribute depthTestAttribute
directionUsageback to summary
protected static final int directionUsage
GPU_ATTRIBUTESback to summary
private static final VertexAttributes GPU_ATTRIBUTES
GPU_COLOR_OFFSETback to summary
private static final int GPU_COLOR_OFFSET
GPU_POSITION_OFFSETback to summary
private static final int GPU_POSITION_OFFSET
GPU_SIZE_ROTATION_OFFSETback to summary
private static final int GPU_SIZE_ROTATION_OFFSET
GPU_UV_OFFSETback to summary
private static final int GPU_UV_OFFSET
GPU_VERTEX_SIZEback to summary
private static final int GPU_VERTEX_SIZE
indicesback to summary
private short[] indices
MAX_PARTICLES_PER_MESHback to summary
private static final int MAX_PARTICLES_PER_MESH
MAX_VERTICES_PER_MESHback to summary
private static final int MAX_VERTICES_PER_MESH
modeback to summary
protected ParticleShader.AlignMode mode
renderablePoolback to summary
private BillboardParticleBatch.RenderablePool renderablePool
renderablesback to summary
private Array<Renderable> renderables
shaderback to summary
pack-priv Shader shader
sizeAndRotationUsageback to summary
protected static final int sizeAndRotationUsage
textureback to summary
protected Texture texture
TMP_M3back to summary
protected static final Matrix3 TMP_M3
TMP_V1back to summary
protected static final Vector3 TMP_V1
TMP_V2back to summary
protected static final Vector3 TMP_V2
TMP_V3back to summary
protected static final Vector3 TMP_V3
TMP_V4back to summary
protected static final Vector3 TMP_V4
TMP_V5back to summary
protected static final Vector3 TMP_V5
TMP_V6back to summary
protected static final Vector3 TMP_V6
useGPUback to summary
protected boolean useGPU
verticesback to summary
private float[] vertices

Constructor Detail

BillboardParticleBatchback to summary
public BillboardParticleBatch(ParticleShader.AlignMode mode, boolean useGPU, int capacity, BlendingAttribute blendingAttribute, DepthTestAttribute depthTestAttribute)

Create a new BillboardParticleBatch

Parameters
useGPU:boolean

Allow to use GPU instead of CPU

capacity:int

Max particle displayed

blendingAttribute:BlendingAttribute

Blending attribute used by the batch

depthTestAttribute:DepthTestAttribute

DepthTest attribute used by the batch

BillboardParticleBatchback to summary
public BillboardParticleBatch(ParticleShader.AlignMode mode, boolean useGPU, int capacity)
BillboardParticleBatchback to summary
public BillboardParticleBatch()
BillboardParticleBatchback to summary
public BillboardParticleBatch(int capacity)

Method Detail

allocIndicesback to summary
private void allocIndices()
allocParticlesDataback to summary
public void allocParticlesData(int capacity)

Implements abstract com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch.allocParticlesData.

Annotations
@Override
allocRenderableback to summary
protected Renderable allocRenderable()
allocRenderablesback to summary
private void allocRenderables(int capacity)
allocShaderback to summary
private void allocShader()
beginback to summary
public void begin()

Overrides com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch.begin.

Implements com.badlogic.gdx.graphics.g3d.particles.batches.ParticleBatch.begin.

Doc from com.badlogic.gdx.graphics.g3d.particles.batches.ParticleBatch.begin.

Must be called once before any drawing operation

Annotations
@Override
clearRenderablesPoolback to summary
private void clearRenderablesPool()
fillVerticesGPUback to summary
private void fillVerticesGPU(int[] particlesOffset)
fillVerticesToScreenCPUback to summary
private void fillVerticesToScreenCPU(int[] particlesOffset)
fillVerticesToViewPointCPUback to summary
private void fillVerticesToViewPointCPU(int[] particlesOffset)
flushback to summary
protected void flush(int[] offsets)

Implements abstract com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch.flush.

Doc from com.badlogic.gdx.graphics.g3d.particles.batches.BufferedParticleBatch.flush.

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.

Annotations
@Override
getAlignModeback to summary
public ParticleShader.AlignMode getAlignMode()
getBlendingAttributeback to summary
public BlendingAttribute getBlendingAttribute()
getRenderablesback to summary
public void getRenderables(Array<Renderable> renderables, Pool<Renderable> pool)

Implements com.badlogic.gdx.graphics.g3d.RenderableProvider.getRenderables.

Doc from com.badlogic.gdx.graphics.g3d.RenderableProvider.getRenderables.

Returns Renderable instances. Renderables are obtained from the provided Pool and added to the provided array. The Renderables obtained using Pool#obtain() will later be put back into the pool, do not store them internally. The resulting array can be rendered via a ModelBatch.

Annotations
@Override
getShaderback to summary
protected Shader getShader(Renderable renderable)
getTextureback to summary
public Texture getTexture()
initRenderDataback to summary
private void initRenderData()

Allocates all the require rendering resources like Renderables,Shaders,Meshes according to the current batch configuration.

isUseGPUback to summary
public boolean isUseGPU()
loadback to summary
public void load(AssetManager manager, ResourceData<T> resources)

Implements com.badlogic.gdx.graphics.g3d.particles.batches.ParticleBatch.load.

Annotations
@Override
putVertexback to summary
private static void putVertex(float[] vertices, int offset, float x, float y, float z, float u, float v, float scaleX, float scaleY, float cosRotation, float sinRotation, float r, float g, float b, float a)
putVertexback to summary
private static void putVertex(float[] vertices, int offset, Vector3 p, float u, float v, float r, float g, float b, float a)
saveback to summary
public void save(AssetManager manager, ResourceData<T> resources)

Implements com.badlogic.gdx.graphics.g3d.particles.batches.ParticleBatch.save.

Annotations
@Override
setAlignModeback to summary
public void setAlignMode(ParticleShader.AlignMode mode)

Sets the current align mode. It will reallocate internal data, use only when necessary.

setTextureback to summary
public void setTexture(Texture texture)
setUseGpuback to summary
public void setUseGpu(boolean useGPU)

Sets the current align mode. It will reallocate internal data, use only when necessary.

setVertexDataback to summary
public void setVertexData()

Sets vertex attributes and size

com.badlogic.gdx.graphics.g3d.particles.batches back to summary

public Class BillboardParticleBatch.Config

extends Object
Class Inheritance
  • java.lang.Object
  • com.badlogic.gdx.graphics.g3d.particles.batches.BillboardParticleBatch.Config

Field Summary

Modifier and TypeField and Description
pack-priv ParticleShader.AlignMode
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public
public
Config(boolean useGPU, ParticleShader.AlignMode mode)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

modeback to summary
pack-priv ParticleShader.AlignMode mode
useGPUback to summary
pack-priv boolean useGPU

Constructor Detail

Configback to summary
public Config()
Configback to summary
public Config(boolean useGPU, ParticleShader.AlignMode mode)
com.badlogic.gdx.graphics.g3d.particles.batches back to summary

private Class BillboardParticleBatch.RenderablePool

extends Pool<Renderable>
Class Inheritance

Field Summary

Inherited from com.badlogic.gdx.utils.Pool:
maxpeak

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Renderable
Inherited from com.badlogic.gdx.utils.Pool:
cleardiscardfillfreefreeAllgetFreeobtainreset

Constructor Detail

RenderablePoolback to summary
public RenderablePool()

Method Detail

newObjectback to summary
public Renderable newObject()

Implements abstract com.badlogic.gdx.utils.Pool.newObject.

Annotations
@Override