- Timestamp:
- Oct 27, 2008, 4:08:51 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/tools/BillboardSet.cc
r1755 r2019 31 31 32 32 #include <sstream> 33 33 #include <cassert> 34 34 #include <OgreSceneManager.h> 35 35 … … 46 46 } 47 47 48 void BillboardSet::setBillboardSet( const std::string& file, int count)48 void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, int count) 49 49 { 50 assert(scenemanager); 51 50 52 std::ostringstream name; 51 53 name << (BillboardSet::billboardSetCounter_s++); 52 this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);54 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count); 53 55 this->billboardSet_->createBillboard(Vector3::ZERO); 54 56 this->billboardSet_->setMaterialName(file); 57 58 this->scenemanager_ = scenemanager; 55 59 } 56 60 57 void BillboardSet::setBillboardSet( const std::string& file, const ColourValue& colour, int count)61 void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, int count) 58 62 { 63 assert(scenemanager); 64 59 65 std::ostringstream name; 60 66 name << (BillboardSet::billboardSetCounter_s++); 61 this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);67 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count); 62 68 this->billboardSet_->createBillboard(Vector3::ZERO, colour); 63 69 this->billboardSet_->setMaterialName(file); 70 71 this->scenemanager_ = scenemanager; 64 72 } 65 73 66 void BillboardSet::setBillboardSet( const std::string& file, const Vector3& position, int count)74 void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const Vector3& position, int count) 67 75 { 76 assert(scenemanager); 77 68 78 std::ostringstream name; 69 79 name << (BillboardSet::billboardSetCounter_s++); 70 this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);80 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count); 71 81 this->billboardSet_->createBillboard(position); 72 82 this->billboardSet_->setMaterialName(file); 83 84 this->scenemanager_ = scenemanager; 73 85 } 74 86 75 void BillboardSet::setBillboardSet( const std::string& file, const ColourValue& colour, const Vector3& position, int count)87 void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, const Vector3& position, int count) 76 88 { 89 assert(scenemanager); 90 77 91 std::ostringstream name; 78 92 name << (BillboardSet::billboardSetCounter_s++); 79 this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);93 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count); 80 94 this->billboardSet_->createBillboard(position, colour); 81 95 this->billboardSet_->setMaterialName(file); 96 97 this->scenemanager_ = scenemanager; 82 98 } 83 99 84 100 BillboardSet::~BillboardSet() 85 101 { 86 if (this->billboardSet_ )87 GraphicsEngine::getInstance().getLevelSceneManager()->destroyBillboardSet(this->billboardSet_);102 if (this->billboardSet_ && this->scenemanager_) 103 this->scenemanager_->destroyBillboardSet(this->billboardSet_); 88 104 } 89 105 }
Note: See TracChangeset
for help on using the changeset viewer.