Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1271


Ignore:
Timestamp:
May 14, 2008, 11:26:34 AM (16 years ago)
Author:
rgrieder
Message:

added TickableReal to tick objects that shouldn't be affected by setTimeFactor

Location:
code/branches/input/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/core/InputBuffer.h

    r1259 r1271  
    4343  {};
    4444
    45   class _CoreExport InputBuffer : public KeyHandler, public Tickable
     45  class _CoreExport InputBuffer : public KeyHandler, public TickableReal
    4646  {
    4747    struct InputBufferListenerTuple
  • code/branches/input/src/core/InputManager.h

    r1259 r1271  
    5151  */
    5252  class _CoreExport InputManager
    53         : public Tickable,
     53        : public TickableReal,
    5454          public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener
    5555  {
  • code/branches/input/src/core/Tickable.cc

    r1062 r1271  
    4040        RegisterRootObject(Tickable);
    4141    }
     42
     43    /**
     44        @brief Constructor: Registers the object in the TickableReal-list
     45    */
     46    TickableReal::TickableReal()
     47    {
     48        RegisterRootObject(TickableReal);
     49    }
    4250}
  • code/branches/input/src/core/Tickable.h

    r1062 r1271  
    6262    };
    6363
     64    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
     65    class _CoreExport TickableReal : virtual public OrxonoxClass
     66    {
     67        public:
     68            /**
     69                @brief Gets called every frame.
     70                @param dt The time since the last frame in seconds
     71            */
     72            virtual void tick(float dt) = 0;
     73
     74        protected:
     75            TickableReal();
     76    };
     77
    6478}
    6579
  • code/branches/input/src/orxonox/Orxonox.cc

    r1259 r1271  
    490490      for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it)
    491491        it->tick((float)evt.timeSinceLastFrame * this->timefactor_);
    492       orxonoxConsole_->tick((float)evt.timeSinceLastFrame * this->timefactor_);
     492      // Iterate through all TickableReals and call their tick(dt) function
     493      for (Iterator<TickableReal> it = ObjectList<TickableReal>::start(); it; ++it)
     494        it->tick((float)evt.timeSinceLastFrame);
     495      orxonoxConsole_->tick((float)evt.timeSinceLastFrame);
    493496
    494497      // don't forget to call _fireFrameStarted in ogre to make sure
Note: See TracChangeset for help on using the changeset viewer.