Class SwarmInfluence
java.lang.Object
com.ardor3d.extension.effect.particle.ParticleInfluence
com.ardor3d.extension.effect.particle.SwarmInfluence
- All Implemented Interfaces:
Savable
Simple swarming influence for use with particles.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
static final double
static final double
static final double
static final double
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply the influence defined by this class on a given particle.Class
<? extends SwarmInfluence> double
double
double
double
double
void
prepare
(ParticleSystem system) Gives the influence a chance to perform any necessary initialization immediately beforeParticleInfluence.apply(double, com.ardor3d.extension.effect.particle.Particle, int)
is called on each particle for the current frame.void
read
(InputCapsule capsule) void
setDeviance
(double deviance) void
setMaxSpeed
(double maxSpeed) void
setSpeedBump
(double speedVariance) void
setSwarmOffset
(ReadOnlyVector3 offset) void
setSwarmRange
(double swarmRange) void
setTurnSpeed
(double turnSpeed) void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.extension.effect.particle.ParticleInfluence
isEnabled, setEnabled
-
Field Details
-
DEFAULT_SWARM_RANGE_SQ
public static final double DEFAULT_SWARM_RANGE_SQ- See Also:
-
DEFAULT_DEVIANCE
public static final double DEFAULT_DEVIANCE- See Also:
-
DEFAULT_TURN_SPEED
public static final double DEFAULT_TURN_SPEED- See Also:
-
DEFAULT_SPEED_BUMP
public static final double DEFAULT_SPEED_BUMP- See Also:
-
DEFAULT_MAX_SPEED
public static final double DEFAULT_MAX_SPEED- See Also:
-
-
Constructor Details
-
SwarmInfluence
public SwarmInfluence() -
SwarmInfluence
-
-
Method Details
-
prepare
Description copied from class:ParticleInfluence
Gives the influence a chance to perform any necessary initialization immediately beforeParticleInfluence.apply(double, com.ardor3d.extension.effect.particle.Particle, int)
is called on each particle for the current frame.- Overrides:
prepare
in classParticleInfluence
- Parameters:
system
- the particle system containing the influence
-
apply
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 classParticleInfluence
- 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
-
setSwarmOffset
-
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
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classParticleInfluence
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classParticleInfluence
- Throws:
IOException
-
getClassTag
- Specified by:
getClassTag
in interfaceSavable
- Overrides:
getClassTag
in classParticleInfluence
-