j3d.examples.particles.influences
Class Attract
java.lang.Object
j3d.examples.particles.influences.Attract
- All Implemented Interfaces:
- ExternalInfluenceInterface
public class Attract
- extends java.lang.Object
- implements ExternalInfluenceInterface
Represents a point in space that attracts particles to
that point based on the distance between the particle
and the attracting point. Once inside the inner
radius, the particle is killed.
Care should be taken with the velocity of the particle
relative to the inner radius. It is possible that the
particle could accelerate through the inner radius during
a time interval dt causing the particle to actually
accelerate away from the point. This can be avoided by
making the inner radius larger.
Constructor Summary |
Attract()
|
Attract(float aRate,
javax.vecmath.Point3d aLocation,
float aRadius)
|
Attract(float aRate,
javax.vecmath.Point3f aLocation)
|
Attract(float aRate,
javax.vecmath.Point3f aLocation,
float aRadius)
|
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 |
Attract
public Attract()
Attract
public Attract(float aRate,
javax.vecmath.Point3f aLocation)
Attract
public Attract(float aRate,
javax.vecmath.Point3d aLocation,
float aRadius)
Attract
public Attract(float aRate,
javax.vecmath.Point3f aLocation,
float aRadius)
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.
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