j3d.examples.particles.influences
Class Bounce

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

public class Bounce
extends java.lang.Object
implements IExternalInfluence

A simulation of Newton�s Law of Restitution for Instantaneous Collisions. Assumes a mostly elastic impulse collision between the "ground" and the particle based on the coefficient of restitution in the world Y coordinate system. Also assumes a simple friction model to slow down the particle in the world X and Z planes.


Constructor Summary
Bounce()
           
Bounce(javax.media.j3d.BoundingBox aBounds)
           
Bounce(javax.media.j3d.BoundingBox aBounds, float aDrag, float aRestitution)
           
 
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

Bounce

public Bounce()

Bounce

public Bounce(javax.media.j3d.BoundingBox aBounds)

Bounce

public Bounce(javax.media.j3d.BoundingBox aBounds,
              float aDrag,
              float aRestitution)
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