|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The ParticleInitializer is registered with a ParticleSystem and is responsible for creating and initialising the particles.
| Method Summary | |
void |
getColor(float[] val)
Get the value of the initial colour that particles are set to. |
float |
getLifetimeVariation()
Get the amount of variation in the lifetime of the particles generated. |
float |
getMass()
Get the current mass assigned to each particle. |
int |
getMaxParticleCount()
Fetch the current value of the maximum particle count. |
int |
getParticleLifetime()
Get the current maximum lifetime of the particles. |
float |
getParticleVariation()
Get the amount of variation in the properties of the particles generated. |
float |
getSpeed()
Get the current speed that particles are initialised with. |
float |
getSurfaceArea()
Get the current surface area assigned to particles. |
boolean |
initialize(Particle particle)
Initialize a particle based on the rules defined by this initializer. |
int |
numParticlesToCreate(int timeDelta)
The number of particles that should be created and initialised this frame. |
void |
setColor(float r,
float g,
float b,
float alpha)
Set the initial color that that the particle is given. |
void |
setLifetimeVariation(float variation)
Change the variation factor for the emitted particles. |
void |
setMass(float mass)
Change the mass of the particle. |
void |
setMaxParticleCount(int maxCount)
Adjust the maximum number of particles that this initializer is going to work with. |
void |
setParticleLifetime(int time)
Change the maximum lifetime of the particles. |
void |
setParticleVariation(float variation)
Change the variation factor for the particles' properties, and does not effect the lifetime variation. |
void |
setSpeed(float speed)
Change the initial speed that the particles are endowed with. |
void |
setSurfaceArea(float area)
Change the apparent surface area. |
| Method Detail |
public void setMaxParticleCount(int maxCount)
maxCount - The new maximum particle count to usepublic int getMaxParticleCount()
public void setParticleLifetime(int time)
throws java.lang.IllegalArgumentException
time - The new lifetime, in seconds
java.lang.IllegalArgumentException - The lifetime is zero or negativepublic int getParticleLifetime()
public void setLifetimeVariation(float variation)
throws java.lang.IllegalArgumentException
variation - The new variation amount
java.lang.IllegalArgumentException - The variation amount was within [0,1]public float getLifetimeVariation()
public void setParticleVariation(float variation)
variation - The new variation amountpublic float getParticleVariation()
public int numParticlesToCreate(int timeDelta)
timeDelta - The delta between the last frame and this one in
milliseconds
public boolean initialize(Particle particle)
particle - The particle instance to initialize
public void setColor(float r,
float g,
float b,
float alpha)
r - The red component of the colorg - The green component of the colorb - The blue component of the coloralpha - The alpha component of the colorpublic void getColor(float[] val)
val - An array of length 4 to copy the internal values into
public void setSurfaceArea(float area)
throws java.lang.IllegalArgumentException
area - The new surface area value to use, in metres squared
java.lang.IllegalArgumentException - The surface area value was negativepublic float getSurfaceArea()
public void setMass(float mass)
throws java.lang.IllegalArgumentException
mass - The mass of an individual particle
java.lang.IllegalArgumentException - The mass value was negativepublic float getMass()
public void setSpeed(float speed)
speed - The magnitude of the speed to usepublic float getSpeed()
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||