Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN_test/src/orxonox/tools/Light.cc @ 758

Last change on this file since 758 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
Line 
1#include <sstream>
2
3#include <OgreSceneManager.h>
4
5#include "../Orxonox.h"
6
7#include "Light.h"
8
9namespace orxonox
10{
11    unsigned int Light::lightCounter_s = 0;
12
13    Light::Light()
14    {
15        this->light_ = 0;
16    }
17
18    void Light::setLight(Ogre::Light::LightTypes type, const ColourValue& diffuse, const ColourValue& specular)
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.