[Orxonox-commit 2469] r7176 - code/trunk/src/orxonox/worldentities

landauf at orxonox.net landauf at orxonox.net
Wed Aug 18 01:01:31 CEST 2010


Author: landauf
Date: 2010-08-18 01:01:31 +0200 (Wed, 18 Aug 2010)
New Revision: 7176

Modified:
   code/trunk/src/orxonox/worldentities/BigExplosion.cc
   code/trunk/src/orxonox/worldentities/BigExplosion.h
Log:
removed some (commented) code from BigExplosion. looks like an attempt to implement some sort of bullet time, but this certainly isn't the right place for this. also made BigExplosion a StaticEntity.

Modified: code/trunk/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.cc	2010-08-17 22:12:42 UTC (rev 7175)
+++ code/trunk/src/orxonox/worldentities/BigExplosion.cc	2010-08-17 23:01:31 UTC (rev 7176)
@@ -28,43 +28,30 @@
 
 #include "BigExplosion.h"
 
-//#include <sstream>
-
 #include "util/Exception.h"
 #include "core/CoreIncludes.h"
-#include "core/CommandExecutor.h"
 #include "core/Executor.h"
 #include "core/GameMode.h"
 #include "tools/ParticleInterface.h"
 #include "Scene.h"
 #include "graphics/ParticleSpawner.h"
 #include "graphics/Model.h"
+#include "MovableEntity.h"
 
 namespace orxonox
 {
     CreateFactory(BigExplosion);
 
-    BigExplosion::BigExplosion(BaseObject* creator) : MovableEntity(creator)
+    BigExplosion::BigExplosion(BaseObject* creator) : StaticEntity(creator)
     {
         RegisterObject(BigExplosion);
 
         if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
             ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
-/*
-        this->cps_ = 1;
-        this->firstTick_ = true;
-*/
+
         this->bStop_ = false;
         this->LOD_ = LODParticle::Normal;
 
-/*      this->stf_ = "setTimeFactor ";
-        this->timeFactor_ =  1;
-        std::ostringstream o;
-        o << stf_ << this->timeFactor_;
-        CommandExecutor::execute(o.str() ,false);
-        this->timeFactor_ = 0.1;
-*/
-
         if ( GameMode::showsGraphics() )
         {
             try
@@ -84,13 +71,9 @@
 
         if (GameMode::isMaster())
         {
-            Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1));
-            velocity.normalise();
-            velocity *= rnd(20, 30);
-            this->setVelocity(velocity);
-
             this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
         }
+
         this->registerVariables();
     }
 
@@ -100,7 +83,7 @@
         this->debrisEntity2_ = new MovableEntity(this);
         this->debrisEntity3_ = new MovableEntity(this);
         this->debrisEntity4_ = new MovableEntity(this);
-        
+
         this->debrisEntity1_->setSyncMode(0);
         this->debrisEntity2_->setSyncMode(0);
         this->debrisEntity3_->setSyncMode(0);
@@ -110,7 +93,7 @@
         this->debris2_ = new Model(this);
         this->debris3_ = new Model(this);
         this->debris4_ = new Model(this);
-        
+
         this->debris1_->setSyncMode(0);
         this->debris2_->setSyncMode(0);
         this->debris3_->setSyncMode(0);
@@ -193,7 +176,7 @@
 
             MovableEntity* partEntity1 = new MovableEntity(this);
             MovableEntity* partEntity2 = new MovableEntity(this);
-            
+
             part1->setSyncMode(0);
             part2->setSyncMode(0);
             partEntity1->setSyncMode(0);
@@ -359,31 +342,4 @@
 
     }
 */
-
-     void BigExplosion::tick(float dt)
-    {
-//        static const unsigned int CHANGES_PER_SECOND = 10;
-
-
-/*        if (GameMode::isMaster() && rnd() < dt*(this->cps_))
-        {
-
-            if(this->timeFactor_ < 1 )
-                this->timeFactor_ += 0.05;
-
-            if(this->firstTick_)
-                this->cps_ = 256;
-
-            std::ostringstream o;
-            o << this->stf_ << this->timeFactor_;
-            CommandExecutor::execute(o.str() ,false);
-            if(this->cps_>50)
-                this->cps_/=2;
-            this->firstTick_ = false;
-            COUT(0) << timeFactor_ << std::endl;
-        }
-*/
-
-        SUPER(BigExplosion, tick, dt);
-    }
 }

Modified: code/trunk/src/orxonox/worldentities/BigExplosion.h
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.h	2010-08-17 22:12:42 UTC (rev 7175)
+++ code/trunk/src/orxonox/worldentities/BigExplosion.h	2010-08-17 23:01:31 UTC (rev 7176)
@@ -31,20 +31,17 @@
 
 #include "OrxonoxPrereqs.h"
 
-#include <string>
 #include "tools/Timer.h"
-#include "MovableEntity.h"
+#include "StaticEntity.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport BigExplosion : public MovableEntity
+    class _OrxonoxExport BigExplosion : public StaticEntity
     {
         public:
             BigExplosion(BaseObject* creator);
             virtual ~BigExplosion();
 
-            virtual void tick(float dt);
-
             inline void setLOD(LODParticle::Value level)
                 { this->LOD_ = level; this->LODchanged(); }
             inline LODParticle::Value getLOD() const
@@ -61,14 +58,7 @@
 
 
             bool                  bStop_;
-            bool                  firstTick_;
 
-            std::string           stf_;
-
-            unsigned int          cps_;
-
-            double                timeFactor_;
-
             StaticEntity*         explosion_;
 
             MovableEntity*        debrisEntity1_;




More information about the Orxonox-commit mailing list