AaronCameron.net
No ads. No Profit. No Master, But Truth.
Not a Member? - Login or Create an Account
Tuesday the 22nd of May 2012 @ 01:57am
Front Page Journal Projects Your Profile About
[]

LibN2L-4 Library Code Reference

Classes
Compounds
Files
Members
Method Index
Full Reference

cPParticleSpec.h

Go to the documentation of this file.
00001 /************************************************************************
00002 Nova-2 Library (libN2L, or simply n2l) Game development C++ Library
00003 Copyright (C) 2003  Aaron Cameron
00004 
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2.1 of the License, or (at your option) any later version.
00009 
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 Lesser General Public License for more details.
00014 
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00018 
00019 A copy of the GNU Lesser General Public License has been provided with
00020 this library in the file 'COPYING'.
00021 
00022 Contact information for the author of this library has been provided
00023 with this library in the file 'AUTHOR'.
00024 ************************************************************************/
00025 #ifndef _n2l4_cPParticleSpec_H
00026 #define _n2l4_cPParticleSpec_H
00027 
00028 #include "n2l/n2l.h"
00029 #include "n2l/geometry.h"
00030 #include "n2l/materials.h"
00031 
00032 #include <vector>
00033 
00034 namespace n2l
00035 {
00036 
00037     class cGLTexture;
00038     class cDynVar;
00039     class cParticle;
00040     class cVfsNodeInterface;
00041 
00053     class cPParticleSpec
00054     {
00055     public:
00056         typedef std::vector<cAutoPtr<const cGLTexture> >    tTextureContainer;
00057         typedef std::vector<cColour>    tColourContainer;
00058 
00059         cPParticleSpec();
00060         cPParticleSpec( const cPParticleSpec &iSpec );
00061         cPParticleSpec( const cDynVar &iDef );
00062         cPParticleSpec( const cVfsNodeInterface &iNode );
00063         ~cPParticleSpec();
00064 
00065         void load( const cDynVar &iDef );
00066         void load( const cVfsNodeInterface &iNode );
00067 
00068         const tColourContainer colours() const { return mColours; }
00069 
00070 //      cPParticleSpec &operator =( const cPParticleSpec &iSpec );
00071 
00072         void clear();
00073 
00074         
00075         cParticle *const newParticle( 
00076             const tVector3f &iPos = tVector3f(0.0f,0.0f,0.0f),
00077             const tVector3f &iVel = tVector3f(0.0f,0.0f,0.0f) ) const;
00078 
00079     private:
00080         typedef enum {
00081             ColourSelect_WhiteToBlack = 0,
00082             ColourSelect_C1ToC2,
00083 
00084             ColourSelect_NumColourSelections
00085         } tColourSelect;
00086 
00087         typedef enum {
00088             GrowthSelect_Static = 0,
00089             GrowthSelect_Uniform,
00090             GrowthSelect_Range,
00091 
00092             GrowthSelect_NumGrowthSelections
00093         } tGrowthSelect;
00094 
00095         typedef enum {
00096             SizeSelect_One = 0,
00097             SizeSelect_Uniform,
00098             SizeSelect_Range,
00099 
00100             SizeSelect_NumSizeSelections
00101         } tSizeSelect;
00102 
00103         typedef std::vector<tVector2f>  tSizeContainer;
00104 
00105         tTextureContainer mTextures;
00106         
00107         tColourSelect mColourSelect;
00108         tColourContainer mColours;
00109 
00110         tGrowthSelect mGrowthSelect;
00111         tSizeContainer mGrowths;
00112 
00113         tSizeSelect mSizeSelect;
00114         tSizeContainer mSizes;
00115 
00116         tUint mLifespan;
00117 
00118         void init();
00119         void free();
00120         
00121     }; // class
00122     
00123 
00124 } // namespace
00125 
00126 #endif
©2012 Aaron Cameron