Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ParticleSystems::Particle Class Reference

The Particle Class. More...

#include <Particle.h>

Inheritance diagram for ParticleSystems::Particle:

ParticleSystems::ImgParticle ParticleSystems::PointParticle ParticleSystems::StrikeParticle List of all members.

Public Member Functions

 Particle (int sysId, Solver *sol)
 The minimal Constructor.
 Particle (int sysId, Solver *sol, GraphicsLib::Point3 pos, GraphicsLib::Vector vel, GraphicsLib::Colour c, GraphicsLib::Colour fc, GLfloat size, GLfloat fsize, GLfloat maxLife)
 The main Constructor.
 Particle (int sysId, GraphicsLib::Point3 pos, GraphicsLib::Vector vel, GraphicsLib::Colour c, GLfloat trans, float b, float ma, float mo, float e, float s)
 The Collision Constructor.
virtual ~Particle ()
 The Destructor.
virtual void draw ()=0
 An abstract Function.
virtual void update ()=0
 An abstract Function.
virtual bool isDead ()=0
 An abstract Function.

Public Attributes

GLfloat life
 A public Variable.
GLfloat MAXLIFE
 A public Variable.
int SYSID
 A public Variable.
Solversolv
 A public Variable.
GraphicsLib::Point3 position
 A public Variable.
GraphicsLib::Point3 old_Position
 A public Variable.
GraphicsLib::Vector velocity
 A public Variable.
GraphicsLib::Vector accel
 A public Variable.
GraphicsLib::Colour colour
 A public Variable.
GraphicsLib::Colour faded_colour
 A public Variable.
GLfloat transparency
 A public Variable.
float bounce
 A public Variable.
float mass
 A public Variable.
float momentum
 A public Variable.
float energy
 A public Variable.
GLfloat size
 A public Variable.
GLfloat flare_size
 A public Variable.
bool dead
 A public Variable.

Detailed Description

The Particle Class.

The Particle Class is the Superclass for all Particles. It provides Constructors as well as abstract methods that need to be implemented by all Subclasses.

Author:
Hannes Ricklefs

Definition at line 33 of file Particle.h.


Constructor & Destructor Documentation

Particle::Particle int  sysId,
Solver sol
 

The minimal Constructor.

This Constructor only takes the ParticleSystem ID and the Solver to update the Particles position.

Parameters:
sysId the ParticleSystem ID this Particle belongs to
sol a pointer to the Solver

Definition at line 61 of file Particle.cpp.

References colour, dead, MAXLIFE, old_Position, position, size, solv, SYSID, and velocity.

Particle::Particle int  sysId,
Solver sol,
GraphicsLib::Point3  pos,
GraphicsLib::Vector  vel,
GraphicsLib::Colour  c,
GraphicsLib::Colour  fc,
GLfloat  size,
GLfloat  fsize,
GLfloat  maxLife
 

The main Constructor.

This Constructor is the main Constructor for a Particle. It sets the most important attributes of a Particle.

Parameters:
sysId the ParticleSystem ID this Particle belongs to
sol a pointer to the Solver
pos the initial Position
vel the inital Velocity
c the initial Colour
fc the fade Colour
size the inital Size
fsize the fade Size
maxLife the maximum Lifespan of the Particle

Definition at line 35 of file Particle.cpp.

References bounce, colour, dead, faded_colour, flare_size, MAXLIFE, old_Position, position, size, solv, SYSID, and velocity.

Particle::Particle int  sysId,
GraphicsLib::Point3  pos,
GraphicsLib::Vector  vel,
GraphicsLib::Colour  c,
GLfloat  trans,
float  b,
float  ma,
float  mo,
float  e,
float  s
 

The Collision Constructor.

A Constructor to set attributes that are needed for Collision

Parameters:
sysId the ParticleSystem ID this Particle belongs to
sol a pointer to the Solver
pos the initial Position
vel the inital Velocity
c the initial Colour
trans the transparency
b the bounceness
ma the mass
mo the momentum
e the energy
s the size

Definition at line 11 of file Particle.cpp.

References bounce, colour, dead, energy, mass, momentum, position, size, SYSID, transparency, and velocity.

Particle::~Particle  )  [virtual]
 

The Destructor.

Destructs the Particle

Definition at line 73 of file Particle.cpp.


Member Function Documentation

virtual void ParticleSystems::Particle::draw  )  [pure virtual]
 

An abstract Function.

Draws the Particle

Implemented in ParticleSystems::ImgParticle, ParticleSystems::PointParticle, and ParticleSystems::StrikeParticle.

virtual bool ParticleSystems::Particle::isDead  )  [pure virtual]
 

An abstract Function.

Returns true if the Particle is dead

Returns:
the value if the Particle is dead

Implemented in ParticleSystems::ImgParticle, ParticleSystems::PointParticle, and ParticleSystems::StrikeParticle.

virtual void ParticleSystems::Particle::update  )  [pure virtual]
 

An abstract Function.

Updates a Particles

Implemented in ParticleSystems::ImgParticle, ParticleSystems::PointParticle, and ParticleSystems::StrikeParticle.


Member Data Documentation

GraphicsLib::Vector ParticleSystems::Particle::accel
 

A public Variable.

The acceleration of the Particle

Definition at line 169 of file Particle.h.

float ParticleSystems::Particle::bounce
 

A public Variable.

The bouncyness of the Particle when colliding

Definition at line 194 of file Particle.h.

Referenced by Particle().

GraphicsLib::Colour ParticleSystems::Particle::colour
 

A public Variable.

The colour of the Particle

Definition at line 175 of file Particle.h.

Referenced by Particle(), ParticleSystems::PointEmitter::reBirth(), and ParticleSystems::PlanarEmitter::reBirth().

bool ParticleSystems::Particle::dead
 

A public Variable.

Specifies if the Particle is dead True if Particle is dead

Definition at line 232 of file Particle.h.

Referenced by Particle(), ParticleSystems::PointEmitter::reBirth(), and ParticleSystems::PlanarEmitter::reBirth().

float ParticleSystems::Particle::energy
 

A public Variable.

The energy of the Particle

Definition at line 212 of file Particle.h.

Referenced by Particle().

GraphicsLib::Colour ParticleSystems::Particle::faded_colour
 

A public Variable.

The fade colour of the Particle If set to zero nothing happens

Definition at line 182 of file Particle.h.

Referenced by Particle(), ParticleSystems::PointEmitter::reBirth(), and ParticleSystems::PlanarEmitter::reBirth().

GLfloat ParticleSystems::Particle::flare_size
 

A public Variable.

The amount the Particle gets reduced each update. If set to zero nothing happens.

Definition at line 225 of file Particle.h.

Referenced by Particle().

GLfloat ParticleSystems::Particle::life
 

A public Variable.

The current life of the Particle

Definition at line 127 of file Particle.h.

Referenced by ParticleSystems::PointEmitter::reBirth(), and ParticleSystems::PlanarEmitter::reBirth().

float ParticleSystems::Particle::mass
 

A public Variable.

The Mass of the Particle

Definition at line 200 of file Particle.h.

Referenced by Particle().

GLfloat ParticleSystems::Particle::MAXLIFE
 

A public Variable.

The Maximum Lifespan of the Particle

Definition at line 133 of file Particle.h.

Referenced by Particle().

float ParticleSystems::Particle::momentum
 

A public Variable.

The momentum of the Particle

Definition at line 206 of file Particle.h.

Referenced by Particle().

GraphicsLib::Point3 ParticleSystems::Particle::old_Position
 

A public Variable.

The old_Position of the Particle

Definition at line 157 of file Particle.h.

Referenced by Particle().

GraphicsLib::Point3 ParticleSystems::Particle::position
 

A public Variable.

The current position of the Particle

Definition at line 151 of file Particle.h.

Referenced by Particle(), ParticleSystems::PointEmitter::reBirth(), and ParticleSystems::PlanarEmitter::reBirth().

GLfloat ParticleSystems::Particle::size
 

A public Variable.

The size of the Particle

Definition at line 218 of file Particle.h.

Referenced by Particle(), ParticleSystems::PointEmitter::reBirth(), and ParticleSystems::PlanarEmitter::reBirth().

Solver* ParticleSystems::Particle::solv
 

A public Variable.

The Solver for this Particle to update the Particles position

Definition at line 145 of file Particle.h.

Referenced by Particle().

int ParticleSystems::Particle::SYSID
 

A public Variable.

The ParticleSystem ID this Particle belongs to

Definition at line 139 of file Particle.h.

Referenced by Particle().

GLfloat ParticleSystems::Particle::transparency
 

A public Variable.

The transparency of the Particle

Definition at line 188 of file Particle.h.

Referenced by Particle().

GraphicsLib::Vector ParticleSystems::Particle::velocity
 

A public Variable.

The speed of the Particle

Definition at line 163 of file Particle.h.

Referenced by Particle(), ParticleSystems::PointEmitter::reBirth(), and ParticleSystems::PlanarEmitter::reBirth().


The documentation for this class was generated from the following files:
Generated on Thu Mar 24 11:05:02 2005 for ParticleSystem by  doxygen 1.4.1