Changeset 7176 for code/trunk/src/orxonox/worldentities
- Timestamp:
- Aug 18, 2010, 1:01:31 AM (14 years ago)
- Location:
- code/trunk/src/orxonox/worldentities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/worldentities/BigExplosion.cc
r7174 r7176 29 29 #include "BigExplosion.h" 30 30 31 //#include <sstream>32 33 31 #include "util/Exception.h" 34 32 #include "core/CoreIncludes.h" 35 #include "core/CommandExecutor.h"36 33 #include "core/Executor.h" 37 34 #include "core/GameMode.h" … … 40 37 #include "graphics/ParticleSpawner.h" 41 38 #include "graphics/Model.h" 39 #include "MovableEntity.h" 42 40 43 41 namespace orxonox … … 45 43 CreateFactory(BigExplosion); 46 44 47 BigExplosion::BigExplosion(BaseObject* creator) : MovableEntity(creator)45 BigExplosion::BigExplosion(BaseObject* creator) : StaticEntity(creator) 48 46 { 49 47 RegisterObject(BigExplosion); … … 51 49 if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) ) 52 50 ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given."); 53 /* 54 this->cps_ = 1; 55 this->firstTick_ = true; 56 */ 51 57 52 this->bStop_ = false; 58 53 this->LOD_ = LODParticle::Normal; 59 54 60 /* this->stf_ = "setTimeFactor ";61 this->timeFactor_ = 1;62 std::ostringstream o;63 o << stf_ << this->timeFactor_;64 CommandExecutor::execute(o.str() ,false);65 this->timeFactor_ = 0.1;66 */67 68 55 if ( GameMode::showsGraphics() ) 69 56 { … … 85 72 if (GameMode::isMaster()) 86 73 { 87 Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1));88 velocity.normalise();89 velocity *= rnd(20, 30);90 this->setVelocity(velocity);91 92 74 this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this))); 93 75 } 76 94 77 this->registerVariables(); 95 78 } … … 101 84 this->debrisEntity3_ = new MovableEntity(this); 102 85 this->debrisEntity4_ = new MovableEntity(this); 103 86 104 87 this->debrisEntity1_->setSyncMode(0); 105 88 this->debrisEntity2_->setSyncMode(0); … … 111 94 this->debris3_ = new Model(this); 112 95 this->debris4_ = new Model(this); 113 96 114 97 this->debris1_->setSyncMode(0); 115 98 this->debris2_->setSyncMode(0); … … 194 177 MovableEntity* partEntity1 = new MovableEntity(this); 195 178 MovableEntity* partEntity2 = new MovableEntity(this); 196 179 197 180 part1->setSyncMode(0); 198 181 part2->setSyncMode(0); … … 360 343 } 361 344 */ 362 363 void BigExplosion::tick(float dt)364 {365 // static const unsigned int CHANGES_PER_SECOND = 10;366 367 368 /* if (GameMode::isMaster() && rnd() < dt*(this->cps_))369 {370 371 if(this->timeFactor_ < 1 )372 this->timeFactor_ += 0.05;373 374 if(this->firstTick_)375 this->cps_ = 256;376 377 std::ostringstream o;378 o << this->stf_ << this->timeFactor_;379 CommandExecutor::execute(o.str() ,false);380 if(this->cps_>50)381 this->cps_/=2;382 this->firstTick_ = false;383 COUT(0) << timeFactor_ << std::endl;384 }385 */386 387 SUPER(BigExplosion, tick, dt);388 }389 345 } -
code/trunk/src/orxonox/worldentities/BigExplosion.h
r7163 r7176 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include <string>35 34 #include "tools/Timer.h" 36 #include " MovableEntity.h"35 #include "StaticEntity.h" 37 36 38 37 namespace orxonox 39 38 { 40 class _OrxonoxExport BigExplosion : public MovableEntity39 class _OrxonoxExport BigExplosion : public StaticEntity 41 40 { 42 41 public: 43 42 BigExplosion(BaseObject* creator); 44 43 virtual ~BigExplosion(); 45 46 virtual void tick(float dt);47 44 48 45 inline void setLOD(LODParticle::Value level) … … 62 59 63 60 bool bStop_; 64 bool firstTick_;65 66 std::string stf_;67 68 unsigned int cps_;69 70 double timeFactor_;71 61 72 62 StaticEntity* explosion_;
Note: See TracChangeset
for help on using the changeset viewer.