j3d.examples.particles.emitters
Class ParticleEmitter

java.lang.Object
  extended by j3d.examples.particles.emitters.ParticleEmitter

public class ParticleEmitter
extends java.lang.Object

The particle emitter is responsible for managing the lifecycle of all particles. It supports a variety of attributes that follow the center value plus variance pattern. The particle emitter depends on a generation shape for the intial placement and velocity of particles. The particle emitter uses influence objects to change aspects of the particles. Particle life cycle listeners are notified by the particle emitter as the particles live their lives.


Constructor Summary
ParticleEmitter(IGenerationShape generationShape, float emissionRate, float emissionRateVariance, float particleVelocity, float particleVelocityVariance, float particleLife, float particleLifeVariance, float emitterLife)
           
ParticleEmitter(IGenerationShape generationShape, float emissionRate, float emissionRateVariance, float particleVelocity, float particleVelocityVariance, float particleLife, float particleLifeVariance, float emitterLife, boolean motionBlur)
           
ParticleEmitter(IGenerationShape generationShape, float emissionRate, float emissionRateVariance, float particleVelocity, float particleVelocityVariance, javax.vecmath.Vector3f particleRotationRate, javax.vecmath.Vector3f particleRotationRateVariance, float particleLife, float particleLifeVariance, float emitterLife)
           
 
Method Summary
 void addInfluence(IExternalInfluence anInfluence)
          Add an external influence to this particle system.
 void addMonitor(IParticleLifeCycleListener aListener)
          Add a new life cycle listener to this particle system.
 void die()
          Kill this particle system.
 float getDelayTime()
           
 int getMaximumParticles()
           
 java.util.List getMonitors()
           
 IParticleSystem getParticleSystem()
           
 float[] getPositions()
          An array of float values representing the x, y, z position of all particles (living or dead).
 float getVaryingParticleLife()
          Get the central value plus random variance value of the particle life time.
 javax.vecmath.Vector3f getVaryingParticleRotationRate()
          Get the central value plus random variance value of the particle rotation rate.
 float getVaryingParticleVelocity()
          Get the central value plus random variance value of the particle velocity.
 void initialize()
           
 boolean isAlive()
           
 boolean isDead()
           
 float random()
           
 void setDelayTime(float dt)
           
 void setParticleSystem(IParticleSystem system)
           
 void update(float dt)
          Update the particle lives based on the time differential.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParticleEmitter

public ParticleEmitter(IGenerationShape generationShape,
                       float emissionRate,
                       float emissionRateVariance,
                       float particleVelocity,
                       float particleVelocityVariance,
                       float particleLife,
                       float particleLifeVariance,
                       float emitterLife)

ParticleEmitter

public ParticleEmitter(IGenerationShape generationShape,
                       float emissionRate,
                       float emissionRateVariance,
                       float particleVelocity,
                       float particleVelocityVariance,
                       float particleLife,
                       float particleLifeVariance,
                       float emitterLife,
                       boolean motionBlur)

ParticleEmitter

public ParticleEmitter(IGenerationShape generationShape,
                       float emissionRate,
                       float emissionRateVariance,
                       float particleVelocity,
                       float particleVelocityVariance,
                       javax.vecmath.Vector3f particleRotationRate,
                       javax.vecmath.Vector3f particleRotationRateVariance,
                       float particleLife,
                       float particleLifeVariance,
                       float emitterLife)
Method Detail

addInfluence

public void addInfluence(IExternalInfluence anInfluence)
Add an external influence to this particle system.

Parameters:
anInfluence - - The influence to add.

addMonitor

public void addMonitor(IParticleLifeCycleListener aListener)
Add a new life cycle listener to this particle system.

Parameters:
aListener - - The listener to be notified of changes

die

public void die()
Kill this particle system.


getDelayTime

public float getDelayTime()

getMaximumParticles

public int getMaximumParticles()

getMonitors

public java.util.List getMonitors()

getParticleSystem

public IParticleSystem getParticleSystem()

getPositions

public float[] getPositions()
An array of float values representing the x, y, z position of all particles (living or dead). Can be used directly with BY_REFERENCE geometry array objects. The first three values represent the x, y, z of the first particle and so on.


getVaryingParticleLife

public float getVaryingParticleLife()
Get the central value plus random variance value of the particle life time.


getVaryingParticleRotationRate

public javax.vecmath.Vector3f getVaryingParticleRotationRate()
Get the central value plus random variance value of the particle rotation rate.


getVaryingParticleVelocity

public float getVaryingParticleVelocity()
Get the central value plus random variance value of the particle velocity.


initialize

public void initialize()

isAlive

public boolean isAlive()

isDead

public boolean isDead()

random

public float random()

setDelayTime

public void setDelayTime(float dt)

setParticleSystem

public void setParticleSystem(IParticleSystem system)

update

public void update(float dt)
Update the particle lives based on the time differential. Manages the lifecycle of the particles (emit new, collect dead, update live). Should only be called by the particle systems.

Parameters:
dt - - The time differential in seconds