Class NewtonianParticleInfluencer

java.lang.Object
com.jme3.effect.influencers.DefaultParticleInfluencer
com.jme3.effect.influencers.NewtonianParticleInfluencer
All Implemented Interfaces:
ParticleInfluencer, Savable, JmeCloneable, Cloneable

public class NewtonianParticleInfluencer extends DefaultParticleInfluencer
This influencer calculates initial velocity with the use of the emitter's shape.
  • Field Details

    • normalVelocity

      protected float normalVelocity
      Normal to emitter's shape factor.
    • surfaceTangentFactor

      protected float surfaceTangentFactor
      Emitter's surface tangent factor.
    • surfaceTangentRotation

      protected float surfaceTangentRotation
      Emitters tangent rotation factor.
  • Constructor Details

    • NewtonianParticleInfluencer

      public NewtonianParticleInfluencer()
      Constructor. Sets velocity variation to 0.0f.
  • Method Details

    • influenceParticle

      public void influenceParticle(Particle particle, EmitterShape emitterShape)
      Description copied from interface: ParticleInfluencer
      This method influences the particle.
      Specified by:
      influenceParticle in interface ParticleInfluencer
      Overrides:
      influenceParticle in class DefaultParticleInfluencer
      Parameters:
      particle - particle to be influenced
      emitterShape - the shape of its emitter
    • getNormalVelocity

      public float getNormalVelocity()
      This method returns the normal velocity factor.
      Returns:
      the normal velocity factor
    • setNormalVelocity

      public void setNormalVelocity(float normalVelocity)
      This method sets the normal velocity factor.
      Parameters:
      normalVelocity - the normal velocity factor
    • setSurfaceTangentFactor

      public void setSurfaceTangentFactor(float surfaceTangentFactor)
      This method sets the surface tangent factor.
      Parameters:
      surfaceTangentFactor - the surface tangent factor
    • getSurfaceTangentFactor

      public float getSurfaceTangentFactor()
      This method returns the surface tangent factor.
      Returns:
      the surface tangent factor
    • setSurfaceTangentRotation

      public void setSurfaceTangentRotation(float surfaceTangentRotation)
      This method sets the surface tangent rotation factor.
      Parameters:
      surfaceTangentRotation - the surface tangent rotation factor
    • getSurfaceTangentRotation

      public float getSurfaceTangentRotation()
      This method returns the surface tangent rotation factor.
      Returns:
      the surface tangent rotation factor
    • applyVelocityVariation

      protected void applyVelocityVariation(Particle particle)
      Description copied from class: DefaultParticleInfluencer
      This method applies the variation to the particle with already set velocity.
      Overrides:
      applyVelocityVariation in class DefaultParticleInfluencer
      Parameters:
      particle - the particle to be affected
    • clone

      Description copied from interface: ParticleInfluencer
      This method clones the influencer instance.
      Specified by:
      clone in interface ParticleInfluencer
      Overrides:
      clone in class DefaultParticleInfluencer
      Returns:
      cloned instance
    • write

      public void write(JmeExporter ex) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class DefaultParticleInfluencer
      Throws:
      IOException
    • read

      public void read(JmeImporter im) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class DefaultParticleInfluencer
      Throws:
      IOException