Class SwarmInfluence

java.lang.Object
com.ardor3d.extension.effect.particle.ParticleInfluence
com.ardor3d.extension.effect.particle.SwarmInfluence
All Implemented Interfaces:
Savable

public class SwarmInfluence extends ParticleInfluence
Simple swarming influence for use with particles.
  • Field Details

  • Constructor Details

    • SwarmInfluence

      public SwarmInfluence()
    • SwarmInfluence

      public SwarmInfluence(ReadOnlyVector3 offset, double swarmRange)
  • Method Details

    • 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(double, com.ardor3d.extension.effect.particle.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(double 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.
    • getSwarmRange

      public double getSwarmRange()
    • setSwarmRange

      public void setSwarmRange(double swarmRange)
    • getSwarmOffset

      public ReadOnlyVector3 getSwarmOffset()
    • setSwarmOffset

      public void setSwarmOffset(ReadOnlyVector3 offset)
    • getDeviance

      public double getDeviance()
    • setDeviance

      public void setDeviance(double deviance)
    • getSpeedBump

      public double getSpeedBump()
    • setSpeedBump

      public void setSpeedBump(double speedVariance)
    • getTurnSpeed

      public double getTurnSpeed()
    • setTurnSpeed

      public void setTurnSpeed(double turnSpeed)
    • getMaxSpeed

      public double getMaxSpeed()
    • setMaxSpeed

      public void setMaxSpeed(double maxSpeed)
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class ParticleInfluence
      Throws:
      IOException
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class ParticleInfluence
      Throws:
      IOException
    • getClassTag

      public Class<? extends SwarmInfluence> getClassTag()
      Specified by:
      getClassTag in interface Savable
      Overrides:
      getClassTag in class ParticleInfluence