Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Particle Class Reference

A Particle is a timed Effect that is affected by gravity. More...

#include <Particle.h>

Inheritance diagram for Particle:

Effect Drawable List of all members.

Public Methods

 Particle (const Point3D &initPos, const Vector3D &initVect, float life)
 Constructor.

virtual ~Particle ()
 Destructor.

void setColor (DWORD color)
 Sets the color for this Particle.

void setSize (float size)
 Sets the size of this particle.

void setBounceFactor (float fact)
 Sets the bounce factor, a number (sane values from 0.0 to 1.0, legal values are >= 0.0) of how much force is rebounded back to the Particle when it bounces.

virtual bool update (float dt)
 Update the logic for the effect.

virtual void draw (const Point &anchor)
 Draw this Effect on the screen, given the anchor point on the screen, which is defined as the center of the Effect's contact with the ground.

virtual float getHeight () const
 Returns the height of the object.

virtual bool needsTransform () const
 A method that returns true if the Drawable will be drawing pre-transformed (XYZRHW) and pre-lit vertices, and its anchor needs transforming due to viewport changes.

virtual const RectgetPosition () const
 Get the current position on the map.


Static Public Methods

void initTextures (GraphicsDevice dev)
 Initializes all textures used for the Particle class.

void releaseTextures ()
 Uninitalizes the work done by initTextures.


Detailed Description

A Particle is a timed Effect that is affected by gravity.


Constructor & Destructor Documentation

Particle::Particle const Point3D   initPos,
const Vector3D   initVect,
float    life
 

Constructor.

Parameters:
initPos  the initial position
initVect  the initial vector
life  how long this Particle lives

Particle::~Particle   [virtual]
 

Destructor.


Member Function Documentation

void Particle::draw const Point   anchor [virtual]
 

Draw this Effect on the screen, given the anchor point on the screen, which is defined as the center of the Effect's contact with the ground.

Implements Effect.

float Particle::getHeight   const [virtual]
 

Returns the height of the object.

If the returned number is negative (the default implementation), the object's height is taken to be the tile's height when it is drawn.

If the number is 0.0f or greater, the height given is taken to be the absolute height, and the tile's height will not be taken into consideration.

The default implementation of getHeight returns a negative number.

Reimplemented from Drawable.

const Rect & Particle::getPosition   [virtual]
 

Get the current position on the map.

Returns:
the current position on the map

Implements Effect.

void Particle::initTextures GraphicsDevice    dev [static]
 

Initializes all textures used for the Particle class.

Throws an IsoException if initialization fails.

bool Particle::needsTransform   const [virtual]
 

A method that returns true if the Drawable will be drawing pre-transformed (XYZRHW) and pre-lit vertices, and its anchor needs transforming due to viewport changes.

Reimplemented from Drawable.

void Particle::releaseTextures   [static]
 

Uninitalizes the work done by initTextures.

If initTextures threw an exception, releaseTextures need not be called.

void Particle::setBounceFactor float    fact
 

Sets the bounce factor, a number (sane values from 0.0 to 1.0, legal values are >= 0.0) of how much force is rebounded back to the Particle when it bounces.

void Particle::setColor DWORD    color
 

Sets the color for this Particle.

void Particle::setSize float    size
 

Sets the size of this particle.

The size should be a whole number.

bool Particle::update float    dt [virtual]
 

Update the logic for the effect.

Parameters:
dt  the amount of time since the last frame
Returns:
true if this Effect should be removed from the game

Implements Effect.


The documentation for this class was generated from the following files:
Generated on Tue Mar 4 02:29:26 2003 for SuperIsoBomb by doxygen1.2.18