simogl.effect.particle
Class AbstractParticle

java.lang.Object
  extended by simogl.effect.particle.AbstractParticle
Direct Known Subclasses:
DDParticle, DLParticle

public abstract class AbstractParticle
extends java.lang.Object

This class represents an abstract particle

Author:
Frank Bruns

Constructor Summary
AbstractParticle(float posX, float posY, float posZ, float velX, float velY, float velZ, long maxAge)
          Creates a new particle
AbstractParticle(float size, Point3D position, Point3D velocity, long maxAge)
          Creates a new particle
 
Method Summary
abstract  void draw(javax.media.opengl.GL gl, float x, float y, float z, com.sun.opengl.util.texture.Texture texture)
          Draws the particle to the scene
 float getAplha()
          Returns the alpha value of the particle
 float[] getColor()
          Returns the RGBA color of the fog as an array of four values
 long getCurrentAge()
          Returns the current age of the particle
 Face getFace()
          Returns the face that represents this particle in the scene
 float getMass()
          Returns the mass value for the particle
 long getMaximumAge()
          Returns the maximum age of the particle
 Point3D getPosition()
          Returns the current position of the particle
 float getSize()
          Returns the designated size of the particle
 Point3D getVelocity()
          Returns the velocity of the particle as a directional vector
 void setAlpha(float alpha)
          Set the alpha value of the particle to the specified parameter.
 void setColor(float red, float green, float blue, float alpha)
          Sets the RGBA color of the particle to the specified values
 void setCurrentAge(long age)
          Sets the current particle age to the specified value
 void setMass(float mass)
          Sets the particle's mass to the specified value
 void setMaximumAge(long maxAge)
          Sets the maximum age of the particle to the specified value
 void setPosition(float x, float y, float z)
          Sets the particle to the specified coordinates
 void setPosition(Point3D position)
          Sets the particle to the specified coordinates
 void setSize(float size)
          Sets the particle size to the specified value
 void setVelocity(float x, float y, float z)
          Sets the particle's velocity to the specified values
 void setVelocity(Point3D velocity)
          Sets the particle's velocity to the specified values
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractParticle

public AbstractParticle(float size,
                        Point3D position,
                        Point3D velocity,
                        long maxAge)
Creates a new particle

Parameters:
size - size of the particle
position - particle's position
velocity - particle's velocity
maxAge - maximum age the particle can reach (in miliseconds)

AbstractParticle

public AbstractParticle(float posX,
                        float posY,
                        float posZ,
                        float velX,
                        float velY,
                        float velZ,
                        long maxAge)
Creates a new particle

Parameters:
posX - x-coordinate
posY - y-coordinate
posZ - z-coordinate
velX - x-velocity
velY - y-velocity
velZ - z-velocity
maxAge - maximum age the particle can reach (in miliseconds)
Method Detail

setColor

public void setColor(float red,
                     float green,
                     float blue,
                     float alpha)
Sets the RGBA color of the particle to the specified values

Parameters:
red - amount of red
green - amount of green
blue - amount of blue
alpha - alpha value

getColor

public float[] getColor()
Returns the RGBA color of the fog as an array of four values

Returns:
RGBA color of the fog

setAlpha

public void setAlpha(float alpha)
Set the alpha value of the particle to the specified parameter.

Parameters:
alpha - new alpha value

getAplha

public float getAplha()
Returns the alpha value of the particle

Returns:
particle's alpha value

getSize

public float getSize()
Returns the designated size of the particle

Returns:
particle's size

setSize

public void setSize(float size)
Sets the particle size to the specified value

Parameters:
size - particle's size

getFace

public Face getFace()
Returns the face that represents this particle in the scene

Returns:
face that represents the particle in the scene

getCurrentAge

public long getCurrentAge()
Returns the current age of the particle

Returns:
current particle age

setCurrentAge

public void setCurrentAge(long age)
Sets the current particle age to the specified value

Parameters:
age - the new current particle age

getMass

public float getMass()
Returns the mass value for the particle

Returns:
mass of the particle

setMass

public void setMass(float mass)
Sets the particle's mass to the specified value

Parameters:
mass - new particle mass

getMaximumAge

public long getMaximumAge()
Returns the maximum age of the particle

Returns:
particle's maximum age

setMaximumAge

public void setMaximumAge(long maxAge)
Sets the maximum age of the particle to the specified value

Parameters:
maxAge - new maximum age of the particle

getPosition

public Point3D getPosition()
Returns the current position of the particle

Returns:
particle's current position

setPosition

public void setPosition(Point3D position)
Sets the particle to the specified coordinates

Parameters:
position - new particle position

setPosition

public void setPosition(float x,
                        float y,
                        float z)
Sets the particle to the specified coordinates

Parameters:
x - x-coordinate
y - y-coordinate
z - z-coordinate

getVelocity

public Point3D getVelocity()
Returns the velocity of the particle as a directional vector

Returns:
particle's velocity

setVelocity

public void setVelocity(Point3D velocity)
Sets the particle's velocity to the specified values

Parameters:
velocity - new particle velocity

setVelocity

public void setVelocity(float x,
                        float y,
                        float z)
Sets the particle's velocity to the specified values

Parameters:
x - x-velocity
y - y-velocity
z - z-velocity

draw

public abstract void draw(javax.media.opengl.GL gl,
                          float x,
                          float y,
                          float z,
                          com.sun.opengl.util.texture.Texture texture)
Draws the particle to the scene

Parameters:
gl -
x - x-coordinate
y - y-coordinate
z - z-coordinate
texture - texture to assign to the particle