j3d.examples.particles.influences
Class BounceShape

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

public class BounceShape
extends Shape3DInfluence
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
BounceShape()
           
BounceShape(javax.media.j3d.Bounds aBounds)
           
BounceShape(javax.media.j3d.Bounds 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.
 float getRestitution()
           
 void initializeParticle(Particle aParticle)
          Initialize a particle prior to the first emission.
 void setRestitution(float f)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BounceShape

public BounceShape()

BounceShape

public BounceShape(javax.media.j3d.Bounds aBounds)

BounceShape

public BounceShape(javax.media.j3d.Bounds aBounds,
                   float aDrag,
                   float aRestitution)
Method Detail

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

getRestitution

public float getRestitution()

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.

setRestitution

public void setRestitution(float f)