Back to index

kdeartwork  4.3.2
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
TurningParticle Class Reference

#include <firesaverparticle.h>

Inheritance diagram for TurningParticle:
Inheritance graph
[legend]
Collaboration diagram for TurningParticle:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ParticleType {
  FireParticle, FireWorkLeaderParticle, FireWorkDebrisParticle, LogoParticle,
  StarParticle
}

Public Member Functions

 TurningParticle (ParticleType pT)
virtual void initializeValues (int color_scheme=0, Particle *leader=0L, GLfloat powermin=5.0, GLfloat powermax=10.0, bool flickers=false, GLfloat *displace=0L)
virtual void updateParameters (float dT)

Public Attributes

ParticleType particleType
int explosionsDepth
unsigned int texture
GLfloat xpos
GLfloat ypos
GLfloat zpos
GLfloat xspeed
GLfloat yspeed
GLfloat zspeed
GLfloat zacc
GLfloat colour [4]
GLfloat life
GLfloat startLife
GLfloat pixelSize
bool useLife
int flicker
float x
float y
float z
float r
float g
float b

Private Member Functions

 TurningParticle ()

Private Attributes

float wx
float wy
float wz

Detailed Description

Definition at line 85 of file firesaverparticle.h.


Member Enumeration Documentation

enum Particle::ParticleType [inherited]
Enumerator:
FireParticle 
FireWorkLeaderParticle 
FireWorkDebrisParticle 
LogoParticle 
StarParticle 

Definition at line 37 of file firesaverparticle.h.


Constructor & Destructor Documentation

Definition at line 206 of file firesaverparticle.cpp.

       : Particle( pT ) {}

Member Function Documentation

void TurningParticle::initializeValues ( int  color_scheme = 0,
Particle leader = 0L,
GLfloat  powermin = 5.0,
GLfloat  powermax = 10.0,
bool  flickers = false,
GLfloat *  displace = 0L 
) [virtual]

Reimplemented from Particle.

Definition at line 209 of file firesaverparticle.cpp.

{
       //same origin of the parent
       xpos = leader->xpos;
       ypos = leader->ypos;
       zpos = leader->zpos;

       //velocity : true spherical randomization
       float   module = powermin + (powermax - powermin) * DRAND * 0.6,
              theta = DRAND * M_PI * 2.0,
              u = DRAND * 2.0 - 1.0,
              root = sqrt( 1 - u*u );
       xspeed = -module * root * cos(theta);
       yspeed = -module * root * sin(theta);
       zspeed = module * u;

       //spin axis : in quadrature with velocity
       module = (1 + DRAND) / 40;
       u = DRAND * 2.0 - 1.0;
       root = sqrt( 1 - u*u );
       // axis to spin around
       wx = module * root * cos(theta + M_PI_2);
       wy = module * root * sin(theta + M_PI_2);
       wz = module * u;

       //randomize the color choosing on current palette
       colour[0] = c_red_min[cs] + (c_red_max[cs]-c_red_min[cs]) * DRAND;
       colour[1] = c_green_min[cs] + (c_green_max[cs]-c_green_min[cs]) * DRAND;
       colour[2] = c_blue_min[cs] + (c_blue_max[cs]-c_blue_min[cs]) * DRAND;

        pixelSize = DRAND * 2.0 + 2.0;
       zacc = -9.807 / 5.0;
       life = startLife = pixelSize / 2.0;
}
void TurningParticle::updateParameters ( float  dT) [virtual]

Reimplemented from Particle.

Definition at line 251 of file firesaverparticle.cpp.

{
       //update position
       xpos += xspeed * dT;
       ypos += yspeed * dT;
       zpos += zspeed * dT;

       //tan vector = velocity vector (vect producted by) spin axis
       float vx = yspeed * wz - zspeed * wy,
             vy = zspeed * wx - xspeed * wz,
             vz = xspeed * wy - yspeed * wx;

       //update velocity adding a tangential component (aka infinitesimally
       //rotating the vector)
       xspeed += vx;
       yspeed += vy;
       zspeed += vz + zacc * dT;

       if (useLife)
              life -= dT;
}

Member Data Documentation

float Particle::b [inherited]

Definition at line 61 of file SolarWinds.cpp.

GLfloat Particle::colour[4] [inherited]

Definition at line 68 of file firesaverparticle.h.

int Particle::explosionsDepth [inherited]

Definition at line 61 of file firesaverparticle.h.

int Particle::flicker [inherited]

Definition at line 73 of file firesaverparticle.h.

float Particle::g [inherited]

Definition at line 61 of file SolarWinds.cpp.

GLfloat Particle::life [inherited]

Definition at line 68 of file firesaverparticle.h.

Definition at line 60 of file firesaverparticle.h.

GLfloat Particle::pixelSize [inherited]

Definition at line 68 of file firesaverparticle.h.

float Particle::r [inherited]

Definition at line 61 of file SolarWinds.cpp.

GLfloat Particle::startLife [inherited]

Definition at line 68 of file firesaverparticle.h.

unsigned int Particle::texture [inherited]

Definition at line 62 of file firesaverparticle.h.

bool Particle::useLife [inherited]

Definition at line 72 of file firesaverparticle.h.

float TurningParticle::wx [private]

Definition at line 101 of file firesaverparticle.h.

float TurningParticle::wy [private]

Definition at line 101 of file firesaverparticle.h.

float TurningParticle::wz [private]

Definition at line 101 of file firesaverparticle.h.

float Particle::x [inherited]

Definition at line 60 of file SolarWinds.cpp.

GLfloat Particle::xpos [inherited]

Definition at line 64 of file firesaverparticle.h.

GLfloat Particle::xspeed [inherited]

Definition at line 64 of file firesaverparticle.h.

float Particle::y [inherited]

Definition at line 60 of file SolarWinds.cpp.

GLfloat Particle::ypos [inherited]

Definition at line 64 of file firesaverparticle.h.

GLfloat Particle::yspeed [inherited]

Definition at line 64 of file firesaverparticle.h.

float Particle::z [inherited]

Definition at line 60 of file SolarWinds.cpp.

GLfloat Particle::zacc [inherited]

Definition at line 64 of file firesaverparticle.h.

GLfloat Particle::zpos [inherited]

Definition at line 64 of file firesaverparticle.h.

GLfloat Particle::zspeed [inherited]

Definition at line 64 of file firesaverparticle.h.


The documentation for this class was generated from the following files: