Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/objects/Light.cc @ 676

Last change on this file since 676 was 676, checked in by landauf, 16 years ago
  • include guards
  • readded Light (maybe i'll remove it again, but at the moment i want it to stay)
File size: 813 bytes
Line 
1#include <sstream>
2
3#include "Light.h"
4#include "../Orxonox.h"
5
6namespace 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.