j3d.examples.particles.influences
Class BounceShape
java.lang.Object
j3d.examples.particles.influences.Shape3DInfluence
j3d.examples.particles.influences.BounceShape
- All Implemented Interfaces:
- ExternalInfluenceInterface
public class BounceShape
- extends Shape3DInfluence
- implements ExternalInfluenceInterface
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.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BounceShape
public BounceShape()
BounceShape
public BounceShape(javax.media.j3d.Bounds aBounds)
BounceShape
public BounceShape(javax.media.j3d.Bounds aBounds,
float aDrag,
float aRestitution)
apply
public void apply(Particle aParticle,
float dt)
- Description copied from interface:
ExternalInfluenceInterface
- Apply this (possibly time varying) influence
to the particle for the time interval.
- Specified by:
apply
in interface ExternalInfluenceInterface
- Parameters:
aParticle
- - The particle to updatedt
- - The time interval (in seconds) since the last apply
getRestitution
public float getRestitution()
initializeParticle
public void initializeParticle(Particle aParticle)
- Description copied from interface:
ExternalInfluenceInterface
- Initialize a particle prior to the first emission.
- Specified by:
initializeParticle
in interface ExternalInfluenceInterface
- Parameters:
aParticle
- - the particle to initialize.
setRestitution
public void setRestitution(float f)