• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.jme3.effect.influencers;
2 
3 import com.jme3.effect.Particle;
4 import com.jme3.effect.ParticleEmitter;
5 import com.jme3.effect.shapes.EmitterShape;
6 import com.jme3.export.Savable;
7 import com.jme3.math.Vector3f;
8 
9 /**
10  * An interface that defines the methods to affect initial velocity of the particles.
11  * @author Marcin Roguski (Kaelthas)
12  */
13 public interface ParticleInfluencer extends Savable, Cloneable {
14 
15     /**
16      * This method influences the particle.
17      * @param particle
18      *        particle to be influenced
19      * @param emitterShape
20      *        the shape of it emitter
21      */
influenceParticle(Particle particle, EmitterShape emitterShape)22     void influenceParticle(Particle particle, EmitterShape emitterShape);
23 
24     /**
25      * This method clones the influencer instance.
26      * @return cloned instance
27      */
clone()28     public ParticleInfluencer clone();
29 
30     /**
31      * @param initialVelocity
32      *        Set the initial velocity a particle is spawned with,
33      *        the initial velocity given in the parameter will be varied according
34      *        to the velocity variation set in {@link ParticleEmitter#setVelocityVariation(float) }.
35      *        A particle will move toward its velocity unless it is effected by the
36      *        gravity.
37      */
setInitialVelocity(Vector3f initialVelocity)38     void setInitialVelocity(Vector3f initialVelocity);
39 
40     /**
41      * This method returns the initial velocity.
42      * @return the initial velocity
43      */
getInitialVelocity()44     Vector3f getInitialVelocity();
45 
46     /**
47      * @param variation
48      *        Set the variation by which the initial velocity
49      *        of the particle is determined. <code>variation</code> should be a value
50      *        from 0 to 1, where 0 means particles are to spawn with exactly
51      *        the velocity given in {@link ParticleEmitter#setStartVel(com.jme3.math.Vector3f) },
52      *        and 1 means particles are to spawn with a completely random velocity.
53      */
setVelocityVariation(float variation)54     void setVelocityVariation(float variation);
55 
56     /**
57      * This method returns the velocity variation.
58      * @return the velocity variation
59      */
getVelocityVariation()60     float getVelocityVariation();
61 }
62