Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/tools/Light.cc @ 750

Last change on this file since 750 was 748, checked in by landauf, 17 years ago
  • moved BillboardSet, Light, Mesh and Timer to the new util folder
  • changed CML files (I hope I did it correctly for both operating systems)
File size: 836 bytes
RevLine 
[676]1#include <sstream>
2
[708]3#include <OgreSceneManager.h>
4
[676]5#include "../Orxonox.h"
6
[708]7#include "Light.h"
8
[676]9namespace orxonox
10{
11    unsigned int Light::lightCounter_s = 0;
12
13    Light::Light()
14    {
15        this->light_ = 0;
16    }
17
[708]18    void Light::setLight(Ogre::Light::LightTypes type, const ColourValue& diffuse, const ColourValue& specular)
[676]19    {
20        std::ostringstream name;
21        name << (Light::lightCounter_s++);
22        this->light_ = Orxonox::getSingleton()->getSceneManager()->createLight("Light" + name.str());
23        this->light_->setType(type);
24        this->light_->setDiffuseColour(diffuse);
25        this->light_->setSpecularColour(specular);
26    }
27
28    Light::~Light()
29    {
30        if (this->light_)
31            Orxonox::getSingleton()->getSceneManager()->destroyLight(this->light_);
32    }
33}
Note: See TracBrowser for help on using the repository browser.