Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/weapon/src/orxonox/tools/Light.cc @ 831

Last change on this file since 831 was 790, checked in by nicolasc, 17 years ago

merged FICN back into trunk
awaiting release.

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