Home | nevrax.com |
|
particle_system_manager.hGo to the documentation of this file.00001 00007 /* Copyright, 2000 - 2002 Nevrax Ltd. 00008 * 00009 * This file is part of NEVRAX NEL. 00010 * NEVRAX NEL is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2, or (at your option) 00013 * any later version. 00014 00015 * NEVRAX NEL is distributed in the hope that it will be useful, but 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 00020 * You should have received a copy of the GNU General Public License 00021 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00022 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00023 * MA 02111-1307, USA. 00024 */ 00025 00026 #ifndef NL_PARTICLE_SYSTEM_MANAGER_H 00027 #define NL_PARTICLE_SYSTEM_MANAGER_H 00028 00029 #include "nel/misc/types_nl.h" 00030 #include "nel/misc/plane.h" 00031 #include "nel/3d/animation_time.h" 00032 00033 00034 #include <list> 00035 #include <vector> 00036 00037 namespace NLMISC 00038 { 00039 class CVector; 00040 } 00041 00042 namespace NL3D { 00043 00044 00045 class CParticleSystemModel; 00046 00058 class CParticleSystemManager 00059 { 00060 public: 00061 enum { NumProcessToRefresh = 3 }; // the number of systems that are refreshed at each call 00062 00064 CParticleSystemManager(); 00065 00067 void refreshModels(const std::vector<NLMISC::CPlane> &worldFrustumPyramid, const NLMISC::CVector &viewerPos); 00068 00070 void processAnimate(TAnimationTime deltaT); 00071 00072 private: 00073 friend class CParticleSystemModel; 00074 typedef std::list<CParticleSystemModel *> TModelList; 00075 00076 struct TModelHandle 00077 { 00078 TModelList::iterator Iter; 00079 bool Valid; 00080 TModelHandle() : Valid(false) {} 00081 }; 00082 00083 00087 TModelHandle addSystemModel(CParticleSystemModel *); 00088 00090 void removeSystemModel(TModelHandle &handle); 00091 00093 TModelHandle addPermanentlyAnimatedSystem(CParticleSystemModel *); 00094 00096 void removePermanentlyAnimatedSystem(TModelHandle &handle); 00097 00098 private: 00099 00100 TModelList::iterator _CurrListIterator; 00101 TModelList _ModelList; 00102 TModelList _PermanentlyAnimatedModelList; 00103 uint _NumModels; 00104 }; 00105 00106 00107 } // NL3D 00108 00109 00110 #endif // NL_PARTICLE_SYSTEM_MANAGER_H 00111 00112 /* End of particle_system_manager.h */ |