|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.effect.influencers.DefaultParticleInfluencer
public class DefaultParticleInfluencer
This emitter influences the particles so that they move all in the same direction. The direction may vary a little if the velocity variation is non zero. This influencer is default for the particle emitter.
Field Summary | |
---|---|
protected Vector3f |
startVelocity
The initial velocity of the particles. |
protected Vector3f |
temp
Temporary variable used to help with calculations. |
protected float |
velocityVariation
The velocity's variation of the particles. |
Constructor Summary | |
---|---|
DefaultParticleInfluencer()
|
Method Summary | |
---|---|
protected void |
applyVelocityVariation(Particle particle)
This method applies the variation to the particle with already set velocity. |
ParticleInfluencer |
clone()
This method clones the influencer instance. |
Vector3f |
getInitialVelocity()
This method returns the initial velocity. |
float |
getVelocityVariation()
This method returns the velocity variation. |
void |
influenceParticle(Particle particle,
EmitterShape emitterShape)
This method influences the particle. |
void |
read(JmeImporter im)
|
void |
setInitialVelocity(Vector3f initialVelocity)
|
void |
setVelocityVariation(float variation)
|
void |
write(JmeExporter ex)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient Vector3f temp
protected Vector3f startVelocity
protected float velocityVariation
Constructor Detail |
---|
public DefaultParticleInfluencer()
Method Detail |
---|
public void influenceParticle(Particle particle, EmitterShape emitterShape)
ParticleInfluencer
influenceParticle
in interface ParticleInfluencer
particle
- particle to be influencedemitterShape
- the shape of it emitterprotected void applyVelocityVariation(Particle particle)
particle
- the particle to be affectedpublic void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
java.io.IOException
public ParticleInfluencer clone()
ParticleInfluencer
clone
in interface ParticleInfluencer
clone
in class java.lang.Object
public void setInitialVelocity(Vector3f initialVelocity)
setInitialVelocity
in interface ParticleInfluencer
initialVelocity
- Set the initial velocity a particle is spawned with,
the initial velocity given in the parameter will be varied according
to the velocity variation set in ParticleEmitter.setVelocityVariation(float)
.
A particle will move toward its velocity unless it is effected by the
gravity.public Vector3f getInitialVelocity()
ParticleInfluencer
getInitialVelocity
in interface ParticleInfluencer
public void setVelocityVariation(float variation)
setVelocityVariation
in interface ParticleInfluencer
variation
- Set the variation by which the initial velocity
of the particle is determined. variation
should be a value
from 0 to 1, where 0 means particles are to spawn with exactly
the velocity given in ParticleEmitter.setInitialVelocity(com.jme3.math.Vector3f)
,
and 1 means particles are to spawn with a completely random velocity.public float getVelocityVariation()
ParticleInfluencer
getVelocityVariation
in interface ParticleInfluencer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |