Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2008, 4:08:51 AM (16 years ago)
Author:
landauf
Message:

many changes, most important: BaseObject takes now a pointer to it's creator which is needed to build a level hierarchy (with different scenes)

File:
1 edited

Legend:

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

    r1755 r2019  
    3131
    3232#include <sstream>
    33 
     33#include <cassert>
    3434#include <OgreSceneManager.h>
    3535
     
    4646    }
    4747
    48     void BillboardSet::setBillboardSet(const std::string& file, int count)
     48    void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, int count)
    4949    {
     50        assert(scenemanager);
     51
    5052        std::ostringstream name;
    5153        name << (BillboardSet::billboardSetCounter_s++);
    52         this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     54        this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count);
    5355        this->billboardSet_->createBillboard(Vector3::ZERO);
    5456        this->billboardSet_->setMaterialName(file);
     57
     58        this->scenemanager_ = scenemanager;
    5559    }
    5660
    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)
    5862    {
     63        assert(scenemanager);
     64
    5965        std::ostringstream name;
    6066        name << (BillboardSet::billboardSetCounter_s++);
    61         this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     67        this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count);
    6268        this->billboardSet_->createBillboard(Vector3::ZERO, colour);
    6369        this->billboardSet_->setMaterialName(file);
     70
     71        this->scenemanager_ = scenemanager;
    6472    }
    6573
    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)
    6775    {
     76        assert(scenemanager);
     77
    6878        std::ostringstream name;
    6979        name << (BillboardSet::billboardSetCounter_s++);
    70         this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     80        this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count);
    7181        this->billboardSet_->createBillboard(position);
    7282        this->billboardSet_->setMaterialName(file);
     83
     84        this->scenemanager_ = scenemanager;
    7385    }
    7486
    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)
    7688    {
     89        assert(scenemanager);
     90
    7791        std::ostringstream name;
    7892        name << (BillboardSet::billboardSetCounter_s++);
    79         this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     93        this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count);
    8094        this->billboardSet_->createBillboard(position, colour);
    8195        this->billboardSet_->setMaterialName(file);
     96
     97        this->scenemanager_ = scenemanager;
    8298    }
    8399
    84100    BillboardSet::~BillboardSet()
    85101    {
    86         if (this->billboardSet_)
    87             GraphicsEngine::getInstance().getLevelSceneManager()->destroyBillboardSet(this->billboardSet_);
     102        if (this->billboardSet_ && this->scenemanager_)
     103            this->scenemanager_->destroyBillboardSet(this->billboardSet_);
    88104    }
    89105}
Note: See TracChangeset for help on using the changeset viewer.