Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 10, 2008, 1:37:36 AM (16 years ago)
Author:
rgrieder
Message:

merged gui back to trunk.
update the media repository!

Location:
code/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/tools/BillboardSet.cc

    r1602 r1755  
    5050        std::ostringstream name;
    5151        name << (BillboardSet::billboardSetCounter_s++);
    52         this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     52        this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
    5353        this->billboardSet_->createBillboard(Vector3::ZERO);
    5454        this->billboardSet_->setMaterialName(file);
     
    5959        std::ostringstream name;
    6060        name << (BillboardSet::billboardSetCounter_s++);
    61         this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     61        this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
    6262        this->billboardSet_->createBillboard(Vector3::ZERO, colour);
    6363        this->billboardSet_->setMaterialName(file);
     
    6868        std::ostringstream name;
    6969        name << (BillboardSet::billboardSetCounter_s++);
    70         this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     70        this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
    7171        this->billboardSet_->createBillboard(position);
    7272        this->billboardSet_->setMaterialName(file);
     
    7777        std::ostringstream name;
    7878        name << (BillboardSet::billboardSetCounter_s++);
    79         this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     79        this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
    8080        this->billboardSet_->createBillboard(position, colour);
    8181        this->billboardSet_->setMaterialName(file);
     
    8585    {
    8686        if (this->billboardSet_)
    87             GraphicsEngine::getSingleton().getSceneManager()->destroyBillboardSet(this->billboardSet_);
     87            GraphicsEngine::getInstance().getLevelSceneManager()->destroyBillboardSet(this->billboardSet_);
    8888    }
    8989}
  • code/trunk/src/orxonox/tools/Light.cc

    r1505 r1755  
    4949        std::ostringstream name;
    5050        name << (Light::lightCounter_s++);
    51         this->light_ = GraphicsEngine::getSingleton().getSceneManager()->createLight("Light" + name.str());
     51        this->light_ = GraphicsEngine::getInstance().getLevelSceneManager()->createLight("Light" + name.str());
    5252        this->light_->setType(type);
    5353        this->light_->setDiffuseColour(diffuse);
     
    5858    {
    5959        if (this->light_)
    60             GraphicsEngine::getSingleton().getSceneManager()->destroyLight(this->light_);
     60            GraphicsEngine::getInstance().getLevelSceneManager()->destroyLight(this->light_);
    6161    }
    6262}
  • code/trunk/src/orxonox/tools/Mesh.cc

    r1505 r1755  
    3131
    3232#include <sstream>
    33 
    3433#include <OgreSceneManager.h>
    35 
    3634#include "GraphicsEngine.h"
     35#include "Settings.h"
    3736
    3837namespace orxonox
     
    4948        std::ostringstream name;
    5049        name << (Mesh::meshCounter_s++);
    51         this->entity_ = GraphicsEngine::getSingleton().getSceneManager()->createEntity("Mesh" + name.str(), file);
     50        if (Settings::showsGraphics())
     51            this->entity_ = GraphicsEngine::getInstance().getLevelSceneManager()->createEntity("Mesh" + name.str(), file);
    5252    }
    5353
    5454    Mesh::~Mesh()
    5555    {
    56         if (this->entity_)
    57             GraphicsEngine::getSingleton().getSceneManager()->destroyEntity(this->entity_);
     56        if (this->entity_ && Settings::showsGraphics())
     57            GraphicsEngine::getInstance().getLevelSceneManager()->destroyEntity(this->entity_);
    5858    }
    5959}
  • code/trunk/src/orxonox/tools/ParticleInterface.cc

    r1563 r1755  
    3939
    4040#include "GraphicsEngine.h"
    41 #include "Orxonox.h"
    4241#include "core/CoreIncludes.h"
    4342#include "util/Convert.h"
     
    5554    this->bEnabled_ = true;
    5655    this->detaillevel_ = (unsigned int)detaillevel;
    57     this->particleSystem_ = GraphicsEngine::getSingleton().getSceneManager()->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
    58     this->particleSystem_->setSpeedFactor(Orxonox::getSingleton()->getTimeFactor());
     56    this->particleSystem_ = GraphicsEngine::getInstance().getLevelSceneManager()->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
     57    //this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor());
     58    this->particleSystem_->setSpeedFactor(1.0f);
    5959
    60     if (GraphicsEngine::getSingleton().getDetailLevelParticle() < (unsigned int)this->detaillevel_)
     60    if (GraphicsEngine::getInstance().getDetailLevelParticle() < (unsigned int)this->detaillevel_)
    6161    {
    6262      this->bVisible_ = false;
     
    7272  {
    7373    this->particleSystem_->removeAllEmitters();
    74     GraphicsEngine::getSingleton().getSceneManager()->destroyParticleSystem(particleSystem_);
     74    GraphicsEngine::getInstance().getLevelSceneManager()->destroyParticleSystem(particleSystem_);
    7575  }
    7676
     
    171171  void ParticleInterface::setSpeedFactor(float factor)
    172172  {
    173     this->particleSystem_->setSpeedFactor(Orxonox::getSingleton()->getTimeFactor() * factor);
     173    //this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor);
     174    this->particleSystem_->setSpeedFactor(1.0f * factor);
    174175  }
    175176  float ParticleInterface::getSpeedFactor() const
    176177  {
    177     return (this->particleSystem_->getSpeedFactor() / Orxonox::getSingleton()->getTimeFactor());
     178    //return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor());
     179    return (this->particleSystem_->getSpeedFactor() / 1.0f);
    178180  }
    179181
  • code/trunk/src/orxonox/tools/Timer.cc

    r1552 r1755  
    3636#include "core/ConsoleCommand.h"
    3737#include "core/CommandExecutor.h"
     38#include "core/Clock.h"
    3839
    3940namespace orxonox
     
    125126        @brief Updates the timer before the frames are rendered.
    126127    */
    127     void TimerBase::tick(float dt)
     128    void TimerBase::tick(const Clock& time)
    128129    {
    129130        if (this->bActive_)
    130131        {
    131132            // If active: Decrease the timer by the duration of the last frame
    132             this->time_ -= dt;
     133            this->time_ -= time.getDeltaTimeMicroseconds();
    133134
    134135            if (this->time_ <= 0)
  • code/trunk/src/orxonox/tools/Timer.h

    r1608 r1755  
    6262
    6363#include "OrxonoxPrereqs.h"
    64 #include "objects/Tickable.h"
     64#include "core/OrxonoxClass.h"
    6565
    6666namespace orxonox
     
    7272
    7373    //! TimerBase is the parent of the Timer class.
    74     class _OrxonoxExport TimerBase : public Tickable
     74    class _OrxonoxExport TimerBase : public OrxonoxClass
    7575    {
    7676        public:
     
    9797            /** @brief Returns the remaining time until the Timer calls the function. @return The remaining time */
    9898            inline float getRemainingTime() const
    99                 { return this->time_; }
     99                { return (float)this->time_ / 1000000.0f; }
    100100            /** @brief Gives the Timer some extra time. @param time The amount of extra time in seconds */
    101101            inline void addTime(float time)
    102                 { this->time_ += time; }
     102                { if (time > 0.0f) this->time_ += (long long)(time * 1000000.0f); }
    103103            /** @brief Decreases the remaining time of the Timer. @param time The amount of time to remove */
    104104            inline void removeTime(float time)
    105                 { this->time_ -= time; }
     105                { if (time > 0.0f) this->time_ -= (long long)(time * 1000000.0f); }
    106106            /** @brief Sets the interval of the Timer. @param interval The interval */
    107107            inline void setInterval(float interval)
    108                 { this->interval_ = interval; }
     108                { this->interval_ = (long long)(interval * 1000000.0f); }
    109109            /** @brief Sets bLoop to a given value. @param bLoop True = loop */
    110110            inline void setLoop(bool bLoop)
    111111                { this->bLoop_ = bLoop; }
    112112
    113             void tick(float dt);
     113            void tick(const Clock& time);
    114114
    115115        protected:
     
    118118            Executor* executor_; //!< The executor of the function that should be called when the time expires
    119119
    120             float interval_;     //!< The time-interval in seconds
     120            long long interval_; //!< The time-interval in micro seconds
    121121            bool bLoop_;         //!< If true, the function gets called every 'interval' seconds
    122122            bool bActive_;       //!< If true, the Timer ticks and calls the function if the time's up
    123123
    124             float time_;         //!< Internal variable, counting the time till the next function-call
     124            long long time_;     //!< Internal variable, counting the time till the next function-call
    125125    };
    126126
     
    155155                this->deleteExecutor();
    156156
    157                 this->interval_ = interval;
     157                this->setInterval(interval);
    158158                this->bLoop_ = bLoop;
    159159                executor->setObject(object);
     
    161161                this->bActive_ = true;
    162162
    163                 this->time_ = interval;
     163                this->time_ = this->interval_;
    164164            }
    165165    };
     
    193193                this->deleteExecutor();
    194194
    195                 this->interval_ = interval;
     195                this->setInterval(interval);
    196196                this->bLoop_ = bLoop;
    197197                this->executor_ = (Executor*)executor;
    198198                this->bActive_ = true;
    199199
    200                 this->time_ = interval;
     200                this->time_ = this->interval_;
    201201            }
    202202    };
  • code/trunk/src/orxonox/tools/WindowEventListener.h

    r1625 r1755  
    4545        virtual ~WindowEventListener() { }
    4646
    47                     /** Window has moved position */
    48                     virtual void windowMoved() { }
     47            /** Window has moved position */
     48            virtual void windowMoved() { }
    4949
    50                     /** Window has resized */
    51                     virtual void windowResized(int newWidth, int newHeight) { }
     50            /** Window has resized */
     51            virtual void windowResized(int newWidth, int newHeight) { }
    5252
    53                     /** Window has lost/gained focus */
    54                     virtual void windowFocusChanged() { }
     53            /** Window has lost/gained focus */
     54            virtual void windowFocusChanged() { }
    5555    };
    5656}
Note: See TracChangeset for help on using the changeset viewer.