Changeset 1629 for code/branches/input/src/orxonox/tools
- Timestamp:
- Jun 27, 2008, 8:07:29 AM (17 years ago)
- 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 46 46 } 47 47 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) 49 76 { 50 77 std::ostringstream name; -
code/branches/input/src/orxonox/tools/BillboardSet.h
r1505 r1629 33 33 34 34 #include <string> 35 #include <OgreBillboardSet.h> 35 36 36 #include <OgreBillboardSet.h>37 37 #include "util/Math.h" 38 38 … … 44 44 BillboardSet(); 45 45 ~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); 47 50 48 51 inline Ogre::BillboardSet* getBillboardSet() … … 51 54 inline const std::string& getName() const 52 55 { 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(); } 53 61 54 62 private: -
code/branches/input/src/orxonox/tools/Mesh.h
r1505 r1629 51 51 { return this->entity_->getName(); } 52 52 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 53 58 private: 54 59 static unsigned int meshCounter_s; -
code/branches/input/src/orxonox/tools/Timer.cc
r1505 r1629 102 102 TimerBase::~TimerBase() 103 103 { 104 if (this->executor_) 105 delete this->executor_; 104 this->deleteExecutor(); 106 105 } 107 106 … … 112 111 { 113 112 (*this->executor_)(); 113 } 114 115 /** 116 @brief Deletes the executor. 117 */ 118 void TimerBase::deleteExecutor() 119 { 120 if (this->executor_) 121 delete this->executor_; 114 122 } 115 123 -
code/branches/input/src/orxonox/tools/Timer.h
r1535 r1629 78 78 79 79 void run() const; 80 void deleteExecutor(); 80 81 81 82 /** @brief Starts the Timer: Function-call after 'interval' seconds. */ … … 94 95 inline bool isActive() const 95 96 { 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_; } 96 100 /** @brief Gives the Timer some extra time. @param time The amount of extra time in seconds */ 97 101 inline void addTime(float time) … … 149 153 void setTimer(float interval, bool bLoop, T* object, ExecutorMember<T>* executor) 150 154 { 155 this->deleteExecutor(); 156 151 157 this->interval_ = interval; 152 158 this->bLoop_ = bLoop; … … 185 191 void setTimer(float interval, bool bLoop, ExecutorStatic* executor) 186 192 { 193 this->deleteExecutor(); 194 187 195 this->interval_ = interval; 188 196 this->bLoop_ = bLoop;
Note: See TracChangeset
for help on using the changeset viewer.