Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 724 was 708, checked in by rgrieder, 17 years ago
  • added Vector2, Vector3, Matrix3, ColourValue, Quaternion and String to the misc folder as header files (each of them contains #include <string> … typedef std::string String , etc.)
  • please use String from now on by including <misc/String.h"
  • removed #include <OgreVector3.h", etc. from "CoreIncludes.h" (adjusted all source files)
  • adjusted all the source files (except network, that keeps <string> for the moment) (what a mess..)
  • moved usleep hack to misc/Sleep.h
  • relative include paths for files from other root directories (like misc, network, etc.) (but it stills writes "../Orxonox.h" when in folder orxonox/objects)
  • "OgreSceneManager.h" —> <OgreSceneManager.h>
  • included OrxonoxPrereqs in every file in folder orxonox
  • moved HUD and ParticleInterface to namespace orxonox
  • removed some using namespace Ogre/std when appropriate
  • I hope I haven't forgotten important points..
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.