j3d.org Code

org.j3d.geom.particle
Class BoundingBoxParticleFunction

java.lang.Object
  extended by org.j3d.geom.particle.BoundingBoxParticleFunction
All Implemented Interfaces:
ParticleFunction

public class BoundingBoxParticleFunction
extends java.lang.Object
implements ParticleFunction

Clamps the position of a particle to within a BoundingBox.

This function should be applied after any other ParticleFunctions which modify a Particle's position (e.g. PhysicsFunction).

Version:
$Revision: 2.0 $
Author:
Daniel Selman

Constructor Summary
BoundingBoxParticleFunction(float[] upper, float[] lower)
          Create a new bounding box function with the given initial bounds
 
Method Summary
 boolean apply(Particle particle)
          Notification that the system is about to do an update of the particles and to do any system-level initialisation.
 boolean isEnabled()
          Check to see if this function has been enabled or not currently.
 boolean newFrame(int deltaT)
          Apply this function to the given particle right now.
 void setEnabled(boolean state)
          Set the enabled state of this function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundingBoxParticleFunction

public BoundingBoxParticleFunction(float[] upper,
                                   float[] lower)
Create a new bounding box function with the given initial bounds

Parameters:
upper - All positive corner of the bounds
lower - All negative corner of the bounds
Method Detail

isEnabled

public boolean isEnabled()
Check to see if this function has been enabled or not currently.

Specified by:
isEnabled in interface ParticleFunction
Returns:
True if this is enabled

setEnabled

public void setEnabled(boolean state)
Set the enabled state of this function. A disabled function will not be applied to particles during this update.

Specified by:
setEnabled in interface ParticleFunction
Parameters:
state - The new enabled state to set it to

newFrame

public boolean newFrame(int deltaT)
Apply this function to the given particle right now.

Specified by:
newFrame in interface ParticleFunction
Parameters:
deltaT - The elapsed time in milliseconds since the last frame
Returns:
true if this should force another update after this one

apply

public boolean apply(Particle particle)
Notification that the system is about to do an update of the particles and to do any system-level initialisation.

Specified by:
apply in interface ParticleFunction
Parameters:
particle - The particle to apply the function to
Returns:
true if this should force another update after this one

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org