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

main.cpp File Reference

#include <iostream>
#include <vector>
#include "GraphicsLib.h"
#include "ThreadTimer.h"
#include <math.h>
#include "ParticleSystems.h"
#include "Debugger.h"

Go to the source code of this file.

Namespaces

namespace  std

Functions

void MakeFloor ()
void display ()
void update ()
void initPSManager ()
void multiCollision ()
void fire ()
void smoke ()
void init ()
void InitGL ()
void resetPMManager ()
void KeyPressed (unsigned char ch, int x, int y)
void SpecialKeyPressed (int key, int x, int y)
void motion (int x, int y)
static void Button (int button, int down, int x, int y)
void intro ()
int main (int argc, char **argv)

Variables

Emitteremit
DataStructuredataParticle
ParticleSystemparticleSys
ParticleSystemManagermanager
int WIDTH = 1024
int HEIGHT = 800
int FRAMESPERSEC = 25
Camera Cam
int spinxface = 0
int spinyface = 0
int spinzface = 0
int origx
int origy
int origz
int RotateXY
int RotateXZ = 0
int Rotate


Function Documentation

static void Button int  button,
int  down,
int  x,
int  y
[static]
 

The button callback is called when a mouse key is pressed

Definition at line 439 of file main.cpp.

References origx, origy, and Rotate.

Referenced by main().

void display  ) 
 

The draw Function draws according to the Framerate

Definition at line 88 of file main.cpp.

References FRAMESPERSEC, manager, ParticleSystems::ParticleSystemManager::render(), spinxface, spinyface, spinzface, and ParticleSystems::ParticleSystemManager::update().

Referenced by main().

void fire  ) 
 

This demonstration shows the use of a texture as well as the change in colour over time.

Definition at line 242 of file main.cpp.

References ParticleSystems::Solver::addForce(), ParticleSystems::ParticleSystemManager::addSystem(), dataParticle, emit, ParticleSystems::Emitter::flareColor, ParticleSystems::ParticleSystemManager::getNextID(), manager, ParticleSystems::Emitter::particleLife, ParticleSystems::Emitter::particleSizeFlare, and particleSys.

Referenced by KeyPressed().

void init  ) 
 

Main init Function initalises the ParticleSystemManager

Definition at line 322 of file main.cpp.

References initPSManager().

Referenced by main().

void InitGL  ) 
 

InitGL set's up the opengl drawing state

Definition at line 327 of file main.cpp.

References Cam.

Referenced by main().

void initPSManager  ) 
 

Initialises the ParticleSystemManager

Definition at line 149 of file main.cpp.

References manager.

Referenced by init(), and KeyPressed().

void intro  ) 
 

Prints the main functions to the screen

Definition at line 459 of file main.cpp.

Referenced by main().

void KeyPressed unsigned char  ch,
int  x,
int  y
 

Definition at line 365 of file main.cpp.

References fire(), initPSManager(), manager, multiCollision(), ParticleSystems::ParticleSystemManager::pause(), resetPMManager(), and smoke().

Referenced by main().

int main int  argc,
char **  argv
 

Application main loop

Definition at line 478 of file main.cpp.

References Button(), display(), HEIGHT, init(), InitGL(), intro(), KeyPressed(), motion(), SpecialKeyPressed(), update(), and WIDTH.

void MakeFloor  ) 
 

Draws a Floor from J. Maceys CameraTest example

Definition at line 58 of file main.cpp.

void motion int  x,
int  y
 

Mouse rotation funciton

Definition at line 424 of file main.cpp.

References origx, origy, Rotate, spinxface, and spinyface.

Referenced by main().

void multiCollision  ) 
 

This method test two things first running multiple ParticleSystems second apply collision detection to both

Definition at line 161 of file main.cpp.

References ParticleSystems::DataStructure::addCollisionObject(), ParticleSystems::Solver::addForce(), ParticleSystems::ParticleSystemManager::addSystem(), ParticleSystems::DataStructure::collision, ParticleSystems::Emitter::flareColor, ParticleSystems::ParticleSystemManager::getNextID(), manager, and ParticleSystems::Emitter::particleLife.

Referenced by KeyPressed().

void resetPMManager  ) 
 

Function to reset the particles and start again

Definition at line 358 of file main.cpp.

References manager, ParticleSystems::ParticleSystemManager::reset(), and ParticleSystems::ParticleSystemManager::restart().

Referenced by KeyPressed().

void smoke  ) 
 

Definition at line 279 of file main.cpp.

References ParticleSystems::Solver::addForce(), ParticleSystems::ParticleSystemManager::addSystem(), dataParticle, emit, ParticleSystems::Emitter::flareColor, ParticleSystems::ParticleSystemManager::getNextID(), manager, ParticleSystems::Emitter::particleLife, ParticleSystems::Emitter::particleSizeFlare, and particleSys.

Referenced by KeyPressed().

void SpecialKeyPressed int  key,
int  x,
int  y
 

Camera controls

Definition at line 388 of file main.cpp.

References Cam.

Referenced by main().

void update  ) 
 

Gets called when the system is idle

Definition at line 143 of file main.cpp.

Referenced by main().


Variable Documentation

Camera Cam
 

Definition at line 47 of file main.cpp.

Referenced by InitGL(), and SpecialKeyPressed().

DataStructure* dataParticle
 

Definition at line 29 of file main.cpp.

Referenced by fire(), and smoke().

Emitter* emit
 

Used by the fire and smoke demo

Definition at line 28 of file main.cpp.

Referenced by fire(), ParticleSystems::ParticleSystem::ParticleSystem(), and smoke().

int FRAMESPERSEC = 25
 

Frame rate per second

Definition at line 44 of file main.cpp.

Referenced by display().

int HEIGHT = 800
 

height of the window

Definition at line 41 of file main.cpp.

Referenced by main().

ParticleSystemManager* manager
 

The ParticleSystemManager to controll all the ParticleSystems

Author:
Hannes Ricklefs

Definition at line 36 of file main.cpp.

Referenced by display(), fire(), initPSManager(), KeyPressed(), multiCollision(), resetPMManager(), and smoke().

int origx
 

Definition at line 52 of file main.cpp.

Referenced by Button(), and motion().

int origy
 

Definition at line 52 of file main.cpp.

Referenced by Button(), and motion().

int origz
 

Definition at line 52 of file main.cpp.

ParticleSystem* particleSys
 

Definition at line 30 of file main.cpp.

Referenced by fire(), and smoke().

int Rotate
 

Definition at line 53 of file main.cpp.

Referenced by Button(), and motion().

int RotateXY
 

Definition at line 52 of file main.cpp.

int RotateXZ = 0
 

Definition at line 52 of file main.cpp.

int spinxface = 0
 

Definition at line 49 of file main.cpp.

Referenced by display(), and motion().

int spinyface = 0
 

Definition at line 50 of file main.cpp.

Referenced by display(), and motion().

int spinzface = 0
 

Definition at line 51 of file main.cpp.

Referenced by display().

int WIDTH = 1024
 

width of the window

Definition at line 39 of file main.cpp.

Referenced by main().


Generated on Thu Mar 24 11:05:02 2005 for ParticleSystem by  doxygen 1.4.1