Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 27, 2008, 8:07:29 AM (17 years ago)
Author:
rgrieder
Message:

updated input branch

Location:
code/branches/input/src/orxonox/tools
Files:
5 edited
6 copied

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/orxonox/tools/BillboardSet.cc

    r1505 r1629  
    4646    }
    4747
    48     void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, int count, const Vector3& position)
     48    void BillboardSet::setBillboardSet(const std::string& file, int count)
     49    {
     50        std::ostringstream name;
     51        name << (BillboardSet::billboardSetCounter_s++);
     52        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     53        this->billboardSet_->createBillboard(Vector3::ZERO);
     54        this->billboardSet_->setMaterialName(file);
     55    }
     56
     57    void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, int count)
     58    {
     59        std::ostringstream name;
     60        name << (BillboardSet::billboardSetCounter_s++);
     61        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     62        this->billboardSet_->createBillboard(Vector3::ZERO, colour);
     63        this->billboardSet_->setMaterialName(file);
     64    }
     65
     66    void BillboardSet::setBillboardSet(const std::string& file, const Vector3& position, int count)
     67    {
     68        std::ostringstream name;
     69        name << (BillboardSet::billboardSetCounter_s++);
     70        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     71        this->billboardSet_->createBillboard(position);
     72        this->billboardSet_->setMaterialName(file);
     73    }
     74
     75    void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, const Vector3& position, int count)
    4976    {
    5077        std::ostringstream name;
  • code/branches/input/src/orxonox/tools/BillboardSet.h

    r1505 r1629  
    3333
    3434#include <string>
     35#include <OgreBillboardSet.h>
    3536
    36 #include <OgreBillboardSet.h>
    3737#include "util/Math.h"
    3838
     
    4444            BillboardSet();
    4545            ~BillboardSet();
    46             void setBillboardSet(const std::string& file, const ColourValue& colour = ColourValue(1.0, 1.0, 1.0), int count = 1, const Vector3& position = Vector3::ZERO);
     46            void setBillboardSet(const std::string& file, int count = 1);
     47            void setBillboardSet(const std::string& file, const ColourValue& colour, int count = 1);
     48            void setBillboardSet(const std::string& file, const Vector3& position, int count = 1);
     49            void setBillboardSet(const std::string& file, const ColourValue& colour, const Vector3& position, int count = 1);
    4750
    4851            inline Ogre::BillboardSet* getBillboardSet()
     
    5154            inline const std::string& getName() const
    5255                { return this->billboardSet_->getName(); }
     56
     57            inline void setVisible(bool visible)
     58                { this->billboardSet_->setVisible(visible); }
     59            inline bool getVisible() const
     60                { return this->billboardSet_->getVisible(); }
    5361
    5462        private:
  • code/branches/input/src/orxonox/tools/Mesh.h

    r1505 r1629  
    5151                { return this->entity_->getName(); }
    5252
     53            inline void setVisible(bool visible)
     54                { if (this->entity_) this->entity_->setVisible(visible); }
     55            inline bool getVisible() const
     56                { if (this->entity_) return this->entity_->getVisible(); else return false; }
     57
    5358        private:
    5459            static unsigned int meshCounter_s;
  • code/branches/input/src/orxonox/tools/Timer.cc

    r1505 r1629  
    102102    TimerBase::~TimerBase()
    103103    {
    104       if (this->executor_)
    105           delete this->executor_;
     104        this->deleteExecutor();
    106105    }
    107106
     
    112111    {
    113112        (*this->executor_)();
     113    }
     114
     115    /**
     116        @brief Deletes the executor.
     117    */
     118    void TimerBase::deleteExecutor()
     119    {
     120      if (this->executor_)
     121          delete this->executor_;
    114122    }
    115123
  • code/branches/input/src/orxonox/tools/Timer.h

    r1535 r1629  
    7878
    7979            void run() const;
     80            void deleteExecutor();
    8081
    8182            /** @brief Starts the Timer: Function-call after 'interval' seconds. */
     
    9495            inline bool isActive() const
    9596                { return this->bActive_; }
     97            /** @brief Returns the remaining time until the Timer calls the function. @return The remaining time */
     98            inline float getRemainingTime() const
     99                { return this->time_; }
    96100            /** @brief Gives the Timer some extra time. @param time The amount of extra time in seconds */
    97101            inline void addTime(float time)
     
    149153            void setTimer(float interval, bool bLoop, T* object, ExecutorMember<T>* executor)
    150154            {
     155                this->deleteExecutor();
     156
    151157                this->interval_ = interval;
    152158                this->bLoop_ = bLoop;
     
    185191            void setTimer(float interval, bool bLoop, ExecutorStatic* executor)
    186192            {
     193                this->deleteExecutor();
     194
    187195                this->interval_ = interval;
    188196                this->bLoop_ = bLoop;
Note: See TracChangeset for help on using the changeset viewer.