j3d.examples.particles.influences
Class Gravity

java.lang.Object
  extended by j3d.examples.particles.influences.Gravity
All Implemented Interfaces:
IExternalInfluence

public class Gravity
extends java.lang.Object
implements IExternalInfluence

A directional gravity influence. The direction and magnitude of the gravity is based on a vector.


Constructor Summary
Gravity()
          Create a default gravity with an acceleration of 9.81 meters per second per second in a downward direction.
Gravity(javax.vecmath.Vector3f anAcceleration)
          Create a gravity with an acceleration determined by the vector.
 
Method Summary
 void apply(Particle aParticle, float dt)
          Apply this (possibly time varying) influence to the particle for the time interval.
 void initializeParticle(Particle aParticle)
          Initialize a particle prior to the first emission.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gravity

public Gravity()
Create a default gravity with an acceleration of 9.81 meters per second per second in a downward direction.


Gravity

public Gravity(javax.vecmath.Vector3f anAcceleration)
Create a gravity with an acceleration determined by the vector.

Method Detail

initializeParticle

public void initializeParticle(Particle aParticle)
Description copied from interface: IExternalInfluence
Initialize a particle prior to the first emission.

Specified by:
initializeParticle in interface IExternalInfluence
Parameters:
aParticle - - the particle to initialize.

apply

public void apply(Particle aParticle,
                  float dt)
Description copied from interface: IExternalInfluence
Apply this (possibly time varying) influence to the particle for the time interval.

Specified by:
apply in interface IExternalInfluence
Parameters:
aParticle - - The particle to update
dt - - The time interval (in seconds) since the last apply