Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2008, 6:01:13 PM (15 years ago)
Author:
landauf
Message:

Merged objecthierarchy2 into presentation branch

Couln't merge 2 lines in Gamestate.cc and a whole block of code in GSDedicated.cc (it seems like oli implemented in both branches something like a network-tick-limiter but with different approaches)

Not yet tested in network mode and with bots
The SpaceShips movement is also not yet fully adopted to the new physics (see Engine class)

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/tools/ParticleInterface.cc

    r2459 r2485  
    5252    ParticleInterface::ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel)
    5353    {
    54         RegisterRootObject(ParticleInterface);
     54        RegisterObject(ParticleInterface);
    5555
    5656        assert(scenemanager);
     
    6262        this->bVisible_ = true;
    6363        this->bAllowedByLOD_ = true;
     64        this->speedFactor_ = 1.0f;
    6465
    6566        if (Core::showsGraphics())
     
    6869            {
    6970                this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
    70                 this->particleSystem_->setSpeedFactor(1.0f);
    71 //                this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor());
     71                this->setSpeedFactor(1.0f);
    7272            }
    7373            catch (...)
     
    200200    void ParticleInterface::setSpeedFactor(float factor)
    201201    {
    202         if (this->particleSystem_)
    203         {
    204 //            this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor);
    205             this->particleSystem_->setSpeedFactor(1.0f * factor);
    206         }
    207     }
    208     float ParticleInterface::getSpeedFactor() const
    209     {
    210         if (this->particleSystem_)
    211         {
    212 //            return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor());
    213             return (this->particleSystem_->getSpeedFactor() / 1.0f);
    214         }
    215         else
    216             return 1.0f;
     202        this->speedFactor_ = factor;
     203
     204        if (this->particleSystem_)
     205            this->particleSystem_->setSpeedFactor(factor * this->getTimeFactor());
     206    }
     207    void ParticleInterface::changedTimeFactor(float factor_new, float factor_old)
     208    {
     209        this->setSpeedFactor(this->speedFactor_);
    217210    }
    218211
Note: See TracChangeset for help on using the changeset viewer.