| Line |   | 
|---|
| 1 | #include <sstream> | 
|---|
| 2 |  | 
|---|
| 3 | #include "Light.h" | 
|---|
| 4 | #include "../Orxonox.h" | 
|---|
| 5 |  | 
|---|
| 6 | namespace orxonox | 
|---|
| 7 | { | 
|---|
| 8 |     unsigned int Light::lightCounter_s = 0; | 
|---|
| 9 |  | 
|---|
| 10 |     Light::Light() | 
|---|
| 11 |     { | 
|---|
| 12 |         this->light_ = 0; | 
|---|
| 13 |     } | 
|---|
| 14 |  | 
|---|
| 15 |     void Light::setLight(Ogre::Light::LightTypes type, const Ogre::ColourValue& diffuse, const Ogre::ColourValue& specular) | 
|---|
| 16 |     { | 
|---|
| 17 |         std::ostringstream name; | 
|---|
| 18 |         name << (Light::lightCounter_s++); | 
|---|
| 19 |         this->light_ = Orxonox::getSingleton()->getSceneManager()->createLight("Light" + name.str()); | 
|---|
| 20 |         this->light_->setType(type); | 
|---|
| 21 |         this->light_->setDiffuseColour(diffuse); | 
|---|
| 22 |         this->light_->setSpecularColour(specular); | 
|---|
| 23 |     } | 
|---|
| 24 |  | 
|---|
| 25 |     Light::~Light() | 
|---|
| 26 |     { | 
|---|
| 27 |         if (this->light_) | 
|---|
| 28 |             Orxonox::getSingleton()->getSceneManager()->destroyLight(this->light_); | 
|---|
| 29 |     } | 
|---|
| 30 | } | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.