Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7176


Ignore:
Timestamp:
Aug 18, 2010, 1:01:31 AM (14 years ago)
Author:
landauf
Message:

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.

Location:
code/trunk/src/orxonox/worldentities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/worldentities/BigExplosion.cc

    r7174 r7176  
    2929#include "BigExplosion.h"
    3030
    31 //#include <sstream>
    32 
    3331#include "util/Exception.h"
    3432#include "core/CoreIncludes.h"
    35 #include "core/CommandExecutor.h"
    3633#include "core/Executor.h"
    3734#include "core/GameMode.h"
     
    4037#include "graphics/ParticleSpawner.h"
    4138#include "graphics/Model.h"
     39#include "MovableEntity.h"
    4240
    4341namespace orxonox
     
    4543    CreateFactory(BigExplosion);
    4644
    47     BigExplosion::BigExplosion(BaseObject* creator) : MovableEntity(creator)
     45    BigExplosion::BigExplosion(BaseObject* creator) : StaticEntity(creator)
    4846    {
    4947        RegisterObject(BigExplosion);
     
    5149        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
    5250            ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
    53 /*
    54         this->cps_ = 1;
    55         this->firstTick_ = true;
    56 */
     51
    5752        this->bStop_ = false;
    5853        this->LOD_ = LODParticle::Normal;
    5954
    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 
    6855        if ( GameMode::showsGraphics() )
    6956        {
     
    8572        if (GameMode::isMaster())
    8673        {
    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 
    9274            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
    9375        }
     76
    9477        this->registerVariables();
    9578    }
     
    10184        this->debrisEntity3_ = new MovableEntity(this);
    10285        this->debrisEntity4_ = new MovableEntity(this);
    103        
     86
    10487        this->debrisEntity1_->setSyncMode(0);
    10588        this->debrisEntity2_->setSyncMode(0);
     
    11194        this->debris3_ = new Model(this);
    11295        this->debris4_ = new Model(this);
    113        
     96
    11497        this->debris1_->setSyncMode(0);
    11598        this->debris2_->setSyncMode(0);
     
    194177            MovableEntity* partEntity1 = new MovableEntity(this);
    195178            MovableEntity* partEntity2 = new MovableEntity(this);
    196            
     179
    197180            part1->setSyncMode(0);
    198181            part2->setSyncMode(0);
     
    360343    }
    361344*/
    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     }
    389345}
  • code/trunk/src/orxonox/worldentities/BigExplosion.h

    r7163 r7176  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include <string>
    3534#include "tools/Timer.h"
    36 #include "MovableEntity.h"
     35#include "StaticEntity.h"
    3736
    3837namespace orxonox
    3938{
    40     class _OrxonoxExport BigExplosion : public MovableEntity
     39    class _OrxonoxExport BigExplosion : public StaticEntity
    4140    {
    4241        public:
    4342            BigExplosion(BaseObject* creator);
    4443            virtual ~BigExplosion();
    45 
    46             virtual void tick(float dt);
    4744
    4845            inline void setLOD(LODParticle::Value level)
     
    6259
    6360            bool                  bStop_;
    64             bool                  firstTick_;
    65 
    66             std::string           stf_;
    67 
    68             unsigned int          cps_;
    69 
    70             double                timeFactor_;
    7161
    7262            StaticEntity*         explosion_;
Note: See TracChangeset for help on using the changeset viewer.