1 //////////////////////////////////////////////////////////////////////////////// 2 // Scorched3D (c) 2000-2011 3 // 4 // This file is part of Scorched3D. 5 // 6 // Scorched3D is free software; you can redistribute it and/or modify 7 // it under the terms of the GNU General Public License as published by 8 // the Free Software Foundation; either version 2 of the License, or 9 // (at your option) any later version. 10 // 11 // Scorched3D is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License along 17 // with this program; if not, write to the Free Software Foundation, Inc., 18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 //////////////////////////////////////////////////////////////////////////////// 20 21 #if !defined(__INCLUDE_ExplosionNukeRendererh_INCLUDE__) 22 #define __INCLUDE_ExplosionNukeRendererh_INCLUDE__ 23 24 #include <actions/Action.h> 25 #include <graph/ParticleEmitter.h> 26 #include <common/Vector.h> 27 #include <list> 28 29 #define ExplosionNukeRenderer_STEPS 100 30 31 class ExplosionNukeRendererEntry : public ParticleUserData 32 { 33 public: 34 ExplosionNukeRendererEntry(Vector &position, float size); 35 virtual ~ExplosionNukeRendererEntry(); 36 37 void simulate(Particle *particle, float time); 38 getCloudRotation()39 float getCloudRotation() { return cloudRotation_; } getRotation()40 Vector &getRotation() { return rotation_; } 41 42 protected: 43 float size_; 44 float totalTime_; 45 float cloudRotation_; 46 Vector rotation_; 47 Vector startPosition_; 48 }; 49 50 class ExplosionNukeRenderer : public ActionRenderer 51 { 52 public: 53 ExplosionNukeRenderer(Vector &position, float size, GLTextureSet *set, bool animate); 54 virtual ~ExplosionNukeRenderer(); 55 56 virtual void draw(Action *action); 57 virtual void simulate(Action *action, float frameTime, bool &remove); 58 59 static Vector *positions_; 60 protected: 61 GLTextureSet *set_; 62 bool animate_; 63 Vector position_; 64 float size_; 65 float time_; 66 float totalTime_; 67 ParticleEmitter emitter_; 68 }; 69 70 #endif 71