public class ParticleSystem
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ParticleSystem.Type |
Constructor and Description |
---|
ParticleSystem(java.lang.String name)
The particle system name is used for performance debugging.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String name,
Shader.AttributeType type)
Add an attribute that will appear in each batch.
|
void |
addTexture(MaplyTexture tex)
Add a texture to the particle system.
|
void |
addTextureID(long texID)
Add a texture to the shader by ID.
|
void |
addVarying(java.lang.String name,
java.lang.String inputName,
Shader.AttributeType type)
For two stage shaders, these are the varying outputs from one shader to the next.
|
void |
finalize() |
double |
getBasetime()
Particles move over time, but current time is a large number.
|
int |
getBatchSize()
Size of the individual batches you add when adding particles.
|
long |
getID()
Returns the unique ID used by the renderer.
|
int |
getTotalParticles()
Total number of particles to display at once.
|
void |
setBasetime(double basetime)
Particles move over time, but current time is a large number.
|
void |
setBatchSize(int batchSize)
Size of the individual batches you add when adding particles.
|
void |
setContinuousUpdate(boolean cRender)
Turn the continuous render on or off.
|
void |
setDrawPriority(int drawPriority)
Set the draw priority for the particles
|
void |
setLifetime(double lifetime)
Sets the particle lifetime.
|
void |
setParticleSystemType(ParticleSystem.Type type)
At present particle systems are just point geometry.
|
void |
setPointSize(float pointSize)
Set the point size if the particle system is points.
|
void |
setPositionShader(Shader shader)
Assign a shader to the position stage of this particle system.
|
void |
setPositionShaderID(long shaderID)
Assign a shader to the position stage of this particle system.
|
void |
setRenderShader(Shader shader)
Assign a shader to the render stage of this particle system.
|
void |
setRenderShaderID(long shaderID)
Assign a shader to the render stage of this particle system.
|
void |
setRenderTarget(RenderTarget target)
If the particle system is drawing to a render target, set it here.
|
void |
setTotalParticles(int totalParticles)
The total number of particles to display at once.
|
void |
setZBufferRead(boolean zBufferRead)
If set we'll compare against the z buffer.
|
void |
setZBufferWrite(boolean zBufferWrite)
If set, we'll write to the z buffer.
|
public ParticleSystem(java.lang.String name)
name
- Name of the particle system.public void finalize()
finalize
in class java.lang.Object
public long getID()
public void setParticleSystemType(ParticleSystem.Type type)
type
- The type of the particle system.public void setPositionShader(Shader shader)
public void setPositionShaderID(long shaderID)
shaderID
- The unique ID of the shaderpublic void setRenderShader(Shader shader)
public void setRenderShaderID(long shaderID)
shaderID
- The unique ID of the shaderpublic void setLifetime(double lifetime)
lifetime
- public void setBasetime(double basetime)
basetime
- public double getBasetime()
public void setTotalParticles(int totalParticles)
totalParticles
- Total number of particles to be represented at once.public int getTotalParticles()
public void setBatchSize(int batchSize)
batchSize
- Batch size for ParticleBatch.public int getBatchSize()
public void setContinuousUpdate(boolean cRender)
public void setDrawPriority(int drawPriority)
public void setPointSize(float pointSize)
public void addAttribute(java.lang.String name, Shader.AttributeType type)
name
- The name of the attribute we'll look for in each batch.type
- Type of the attribute.public void addVarying(java.lang.String name, java.lang.String inputName, Shader.AttributeType type)
name
- The name of the varying outputinputName
- Name of the input to the next shadertype
- Data type of the varyingpublic void addTexture(MaplyTexture tex)
public void addTextureID(long texID)
public void setZBufferRead(boolean zBufferRead)
public void setZBufferWrite(boolean zBufferWrite)
public void setRenderTarget(RenderTarget target)