Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/tools/Light.cc @ 1025

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

merged FICN back into trunk
awaiting release.

File size: 873 bytes
RevLine 
[786]1#include "OrxonoxStableHeaders.h"
[784]2
[676]3#include <sstream>
4
[708]5#include <OgreSceneManager.h>
6
[676]7#include "../Orxonox.h"
8
[708]9#include "Light.h"
10
[676]11namespace orxonox
12{
13    unsigned int Light::lightCounter_s = 0;
14
15    Light::Light()
16    {
17        this->light_ = 0;
18    }
19
[708]20    void Light::setLight(Ogre::Light::LightTypes type, const ColourValue& diffuse, const ColourValue& specular)
[676]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.