PSystem.h

Go to the documentation of this file.
00001 
00002 //
00003 // Das Tank - Copyright (C) 2006, 2007 Windsor Schmidt <windsor@windsorworld.net>
00004 //
00005 // This program is free software; you can redistribute it and/or modify it
00006 // under the terms of the GNU General Public License as published by the Free
00007 // Software Foundation; either version 2 of the License, or (at your option)
00008 // any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful, but WITHOUT
00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
00013 // more details.
00014 //
00015 // You should have received a copy of the GNU General Public License along with
00016 // this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00017 // Place, Suite 330, Boston, MA 02111-1307 USA
00018 //
00020 
00021 
00022 #ifndef STDAFX
00023 #include "stdafx.h"
00024 #endif
00025 
00026 #define MAX_PARTICLES 100 
00027 
00028 
00034 typedef struct Particle {                 
00035        float fPosX;         
00036        float fPosY;         
00037        float fAngle;        
00038 
00039        float fVelX;         
00040        float fVelY;         
00041        float fRotVel;              
00042        
00043        float fSize;         
00044        float fEnergy;              
00045        float fDecayRate;    
00046 
00047        bool bAlive;         
00048 } Particle;
00049 
00050 
00060 class PSystem
00061 {
00062 public:
00063        Vector vPosition;           
00064        Vector vForce;                     
00065        float fSpreadAngle;         
00066        float fFriction;            
00067        int iNumParticles;          
00068        Particle * pParticles;      
00069        float fRandomness;          
00070        float fDecayRate;           
00071        float fColorR;                     
00072        float fColorG;                     
00073        float fColorB;                     
00074 
00075        PSystem::PSystem(void); 
00076        PSystem::PSystem(Vector vPos, Vector vFce,
00077                                     float fSAngle, float fFric,
00078                                     float fRand, int iParticles); 
00079        PSystem::~PSystem(void); 
00080        void PSystem::Draw(void); 
00081        bool PSystem::Step(float timeStep); 
00082        void PSystem::SetColor(float r, float g, float b); 
00083 };

 

Copyright Windsor Schmidt 2006 - All rights reserved.