j3d.examples.particles.influences
Class EmitShapeLight

java.lang.Object
  extended by j3d.examples.particles.influences.Shape3DInfluence
      extended by j3d.examples.particles.influences.EmitShapeLight
All Implemented Interfaces:
IParticleLifeCycleListener, IExternalInfluence

public class EmitShapeLight
extends Shape3DInfluence
implements IExternalInfluence, IParticleLifeCycleListener


Constructor Summary
EmitShapeLight(javax.vecmath.Color3f aColor, float aConstant, float aLinear, float aQuadradic)
          Emit a burst of colored light and slowly decrease the intensity as the particle ages.
EmitShapeLight(float aConstant, float aLinear, float aQuadradic)
          Emit a burst of white light and slowly decrease the intensity as the particle ages.
EmitShapeLight(ParticleAgeAlpha anAlpha, javax.vecmath.Color3f aColor, float aConstant, float aLinear, float aQuadradic)
          Emit a point light based on the particle age alpha.
 
Method Summary
 void aboutToDie(java.util.List aList, float dt)
           
 void aboutToEmit(java.util.List aList, float dt)
           
 void apply(Particle aParticle, float dt)
          Apply this (possibly time varying) influence to the particle for the time interval.
 void initializeParticle(Particle aParticle)
          Initialize a particle prior to the first emission.
 void updated(java.util.List c, float dt)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmitShapeLight

public EmitShapeLight(float aConstant,
                      float aLinear,
                      float aQuadradic)
Emit a burst of white light and slowly decrease the intensity as the particle ages. Use the attentuation parameters (constant, linear, quadradic) to control the attenuation of the point lights. Note: This implementation uses a point light for each particle which can have significant performance issues with a large number or if the lifespan of the particle is short (less than 1 or 2 seconds).


EmitShapeLight

public EmitShapeLight(javax.vecmath.Color3f aColor,
                      float aConstant,
                      float aLinear,
                      float aQuadradic)
Emit a burst of colored light and slowly decrease the intensity as the particle ages. Use the attentuation parameters (constant, linear, quadradic) to control the attenuation of the point lights. Note: This implementation uses a point light for each particle which can have significant performance issues with a large number or if the lifespan of the particle is short (less than 1 or 2 seconds).


EmitShapeLight

public EmitShapeLight(ParticleAgeAlpha anAlpha,
                      javax.vecmath.Color3f aColor,
                      float aConstant,
                      float aLinear,
                      float aQuadradic)
Emit a point light based on the particle age alpha. One minus the alpha value is used for the attenuation parameters, so you can think of the alpha value as the brightness of the point light.

Method Detail

initializeParticle

public void initializeParticle(Particle aParticle)
Description copied from interface: IExternalInfluence
Initialize a particle prior to the first emission.

Specified by:
initializeParticle in interface IExternalInfluence
Parameters:
aParticle - - the particle to initialize.

apply

public void apply(Particle aParticle,
                  float dt)
Description copied from interface: IExternalInfluence
Apply this (possibly time varying) influence to the particle for the time interval.

Specified by:
apply in interface IExternalInfluence
Parameters:
aParticle - - The particle to update
dt - - The time interval (in seconds) since the last apply

aboutToDie

public void aboutToDie(java.util.List aList,
                       float dt)
Specified by:
aboutToDie in interface IParticleLifeCycleListener

aboutToEmit

public void aboutToEmit(java.util.List aList,
                        float dt)
Specified by:
aboutToEmit in interface IParticleLifeCycleListener

updated

public void updated(java.util.List c,
                    float dt)
Specified by:
updated in interface IParticleLifeCycleListener