com.jmex.effects.particles
Class SimpleParticleInfluenceFactory.BasicDrag

java.lang.Object
  extended by com.jmex.effects.particles.ParticleInfluence
      extended by com.jmex.effects.particles.SimpleParticleInfluenceFactory.BasicDrag
All Implemented Interfaces:
Savable
Enclosing class:
SimpleParticleInfluenceFactory

public static class SimpleParticleInfluenceFactory.BasicDrag
extends ParticleInfluence


Constructor Summary
SimpleParticleInfluenceFactory.BasicDrag()
           
SimpleParticleInfluenceFactory.BasicDrag(float dragCoef)
           
 
Method Summary
 void apply(float dt, Particle p, int index)
          Apply the influence defined by this class on a given particle.
 java.lang.Class getClassTag()
           
 float getDragCoefficient()
           
 void read(JMEImporter e)
           
 void setDragCoefficient(float dragCoef)
           
 void write(JMEExporter e)
           
 
Methods inherited from class com.jmex.effects.particles.ParticleInfluence
isEnabled, prepare, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleParticleInfluenceFactory.BasicDrag

public SimpleParticleInfluenceFactory.BasicDrag()

SimpleParticleInfluenceFactory.BasicDrag

public SimpleParticleInfluenceFactory.BasicDrag(float dragCoef)
Method Detail

getDragCoefficient

public float getDragCoefficient()

setDragCoefficient

public void setDragCoefficient(float dragCoef)

apply

public void apply(float dt,
                  Particle p,
                  int index)
Description copied from class: ParticleInfluence
Apply the influence defined by this class on a given particle. Should probably do this by making a call to particle.getSpeed().addLocal(....); etc.

Specified by:
apply in class ParticleInfluence
Parameters:
dt - amount of time since last apply call in ms.
p - the particle to apply the influence to.
index - the index of the particle we are working with. This is useful for adding small steady amounts of variation, or remembering information.

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class ParticleInfluence
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class ParticleInfluence
Throws:
java.io.IOException

getClassTag

public java.lang.Class getClassTag()
Specified by:
getClassTag in interface Savable
Overrides:
getClassTag in class ParticleInfluence