com.jmex.effects.particles
Class WanderInfluence

java.lang.Object
  extended by com.jmex.effects.particles.ParticleInfluence
      extended by com.jmex.effects.particles.WanderInfluence
All Implemented Interfaces:
Savable

public class WanderInfluence
extends ParticleInfluence


Field Summary
static float DEFAULT_DISTANCE
           
static float DEFAULT_JITTER
           
static float DEFAULT_RADIUS
           
 
Constructor Summary
WanderInfluence()
           
 
Method Summary
 void apply(float dt, Particle particle, int index)
          Apply the influence defined by this class on a given particle.
 float getWanderDistance()
           
 float getWanderJitter()
           
 float getWanderRadius()
           
 void prepare(ParticleSystem system)
          Gives the influence a chance to perform any necessary initialization immediately before ParticleInfluence.apply(float, com.jmex.effects.particles.Particle, int) is called on each particle for the current frame.
 void read(JMEImporter e)
           
 void setWanderDistance(float wanderDistance)
           
 void setWanderJitter(float wanderJitter)
           
 void setWanderRadius(float wanderRadius)
           
 void write(JMEExporter e)
           
 
Methods inherited from class com.jmex.effects.particles.ParticleInfluence
getClassTag, isEnabled, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RADIUS

public static final float DEFAULT_RADIUS
See Also:
Constant Field Values

DEFAULT_DISTANCE

public static final float DEFAULT_DISTANCE
See Also:
Constant Field Values

DEFAULT_JITTER

public static final float DEFAULT_JITTER
See Also:
Constant Field Values
Constructor Detail

WanderInfluence

public WanderInfluence()
Method Detail

prepare

public void prepare(ParticleSystem system)
Description copied from class: ParticleInfluence
Gives the influence a chance to perform any necessary initialization immediately before ParticleInfluence.apply(float, com.jmex.effects.particles.Particle, int) is called on each particle for the current frame.

Overrides:
prepare in class ParticleInfluence
Parameters:
system - the particle system containing the influence

apply

public void apply(float dt,
                  Particle particle,
                  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.
particle - 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.

getWanderDistance

public float getWanderDistance()

setWanderDistance

public void setWanderDistance(float wanderDistance)

getWanderJitter

public float getWanderJitter()

setWanderJitter

public void setWanderJitter(float wanderJitter)

getWanderRadius

public float getWanderRadius()

setWanderRadius

public void setWanderRadius(float wanderRadius)

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