Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 11, 2008, 3:06:33 AM (16 years ago)
Author:
landauf
Message:

Added TimeFactorListener to properly handle changes of the global time factor (makes the game faster or slower). Currently supported in Backlight, ParticleInterface and Timer, which were all critical classes I could think of (all other classes are already covered by the adjustment of dt in tick(dt)). It seems to work well, both with small values (0.1, 0.01) and great values (10, 100). Even pausing the game (0) works fine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/tools/ParticleInterface.h

    r2087 r2406  
    3737#include "core/OrxonoxClass.h"
    3838#include "util/Math.h"
     39#include "gamestates/GSRoot.h"
    3940
    4041#define getAllEmitters() \
     
    4546namespace orxonox
    4647{
    47     class _OrxonoxExport ParticleInterface : public OrxonoxClass
     48    class _OrxonoxExport ParticleInterface : public TimeFactorListener
    4849    {
    4950        public:
     
    6970            unsigned int getNumAffectors() const;
    7071
    71             float getSpeedFactor() const;
     72            inline float getSpeedFactor() const
     73                { return this->speedFactor_; }
    7274            void setSpeedFactor(float factor);
    7375            bool getKeepParticlesInLocalSpace() const;
     
    9092                { return ParticleInterface::currentParticleInterface_s; }
    9193
     94        protected:
     95            virtual void changedTimeFactor(float factor_new, float factor_old);
     96
    9297        private:
    9398            void updateVisibility();
     
    102107            bool                      bAllowedByLOD_;
    103108            unsigned int              detaillevel_;     //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
     109            float                     speedFactor_;
    104110            Ogre::SceneManager*       scenemanager_;
    105111    };
Note: See TracChangeset for help on using the changeset viewer.