Shockwave Class Reference

#include <Shockwave.h>

Collaboration diagram for Shockwave:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class represents a 2D shockwave effect, radiating outward from it's creation position. It can be thought of as a 2D special effect overlay, and does not affect the geometry or game objects in any way.

Definition at line 31 of file Shockwave.h.

Public Member Functions

 Shockwave (void)
 default constructor
 Shockwave (Vector vPos, float energy)
 general constructor
 ~Shockwave (void)
 remove the effect
void Draw (void)
 draws the effect in it's current state
bool Step (float timeStep)
 advance the state of the effect
void SetColor (float r, float g, float b)
 set the color used to draw the effect

Public Attributes

Vector vPosition
 absolute position of the effect's origin
float fEnergy
 energy of the wave (relates to lifespan)
float fDecayRate
 rate at which wave loses energy
float fAge
 how long the wave has been around
float fColorR
 red color component
float fColorG
 green color component
float fColorB
 blue color component


Constructor & Destructor Documentation

Shockwave::Shockwave ( void   ) 

Definition at line 28 of file Shockwave.cpp.

References fAge, fColorB, fColorG, fColorR, fEnergy, vPosition, and Vector::x.

Shockwave::Shockwave ( Vector  vPos,
float  energy 
)

Initialize the effect, specifying initial parameters including position and energy.

Definition at line 42 of file Shockwave.cpp.

References fAge, fColorB, fColorG, fColorR, fEnergy, and vPosition.

Shockwave::~Shockwave ( void   ) 

Definition at line 55 of file Shockwave.cpp.


Member Function Documentation

void Shockwave::Draw ( void   ) 

Definition at line 61 of file Shockwave.cpp.

References DrawCircle(), DrawDisc(), DrawStar(), fAge, fColorB, fColorG, fColorR, fEnergy, vPosition, Vector::x, and Vector::y.

Referenced by CEffect::Draw().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Shockwave::Step ( float  timeStep  ) 

As the effect is stepped forward in time, a set of concentric rings orginating at the effects center are expanded and reduced in opacity to create the 'shock wave' effect.

Definition at line 87 of file Shockwave.cpp.

References fAge, and fEnergy.

Referenced by CEffect::Step().

Here is the caller graph for this function:

void Shockwave::SetColor ( float  r,
float  g,
float  b 
)

Set the color of the effect, with individual intensity values for red, green, and blue color components.

Definition at line 106 of file Shockwave.cpp.

References fColorB, fColorG, and fColorR.

Referenced by RemoveDeadObjects().

Here is the caller graph for this function:


Member Data Documentation

Vector Shockwave::vPosition

Definition at line 34 of file Shockwave.h.

Referenced by Draw(), and Shockwave().

float Shockwave::fEnergy

Definition at line 35 of file Shockwave.h.

Referenced by Draw(), Shockwave(), and Step().

float Shockwave::fDecayRate

Definition at line 36 of file Shockwave.h.

float Shockwave::fAge

Definition at line 37 of file Shockwave.h.

Referenced by Draw(), Shockwave(), and Step().

float Shockwave::fColorR

Definition at line 38 of file Shockwave.h.

Referenced by Draw(), SetColor(), and Shockwave().

float Shockwave::fColorG

Definition at line 39 of file Shockwave.h.

Referenced by Draw(), SetColor(), and Shockwave().

float Shockwave::fColorB

Definition at line 40 of file Shockwave.h.

Referenced by Draw(), SetColor(), and Shockwave().

 

Copyright Windsor Schmidt 2006 - All rights reserved.