Index: orxonox/trunk/src/lib/graphics/light.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/light.cc	(revision 4734)
+++ orxonox/trunk/src/lib/graphics/light.cc	(revision 4735)
@@ -44,5 +44,4 @@
 };
 
-
 /**
    \param lightNumber the Light Number to initiate
@@ -86,5 +85,4 @@
   // set values (defaults)
   this->lightNumber = lightNumber;
-  this->setPosition(0,0,0);
   this->setDiffuseColor(1.0, 1.0, 1.0);
   this->setSpecularColor(1.0, 1.0, 1.0);
@@ -110,34 +108,4 @@
       .describe("the cuttoff of the Spotlight");
 }
-
-/**
-   \brief Sets a Position for the Light.
-   \param position The new position of the Light.
-   \todo patrick: is it ok to set a Light Position even if it is derived from p_node??
-*/
-void Light::setPosition(const Vector& position)
-{
-  this->lightPosition[0] = position.x;
-  this->lightPosition[1] = position.y;
-  this->lightPosition[2] = position.z;
-  this->lightPosition[3] = 0.0;
-
-  this->setAbsCoor(position);
-
-  glLightfv (lightsV[this->lightNumber], GL_POSITION, this->lightPosition);
-}
-
-
-/**
-   \brief Sets a Position of this Light.
-   \param x the x-coordinate
-   \param y the y-coordinate
-   \param z the z-coordinate
-*/
-void Light::setPosition(GLfloat x, GLfloat y, GLfloat z)
-{
-  this->setPosition(Vector(x, y, z));
-}
-
 
 /**
@@ -215,14 +183,4 @@
   glLightf(lightsV[this->lightNumber], GL_SPOT_CUTOFF, cutoff);
 }
-
-
-/**
-   \returns the Position of the Light
-*/
-Vector Light::getPosition() const
-{
-  return Vector(this->lightPosition[0], this->lightPosition[1], this->lightPosition[2]);
-}
-
 
 /**
@@ -251,5 +209,4 @@
     PRINT(0)("OFF\n");
 
-  PRINT(0)(" Position:      %f/%f/%f\n", this->lightPosition[0], this->lightPosition[1], this->lightPosition[2]);
   PRINT(0)(" DiffuseColor:  %f/%f/%f\n", this->diffuseColor[0], this->diffuseColor[1], this->diffuseColor[2]);
   PRINT(0)(" SpecularColor: %f/%f/%f\n", this->specularColor[0], this->specularColor[1], this->specularColor[2]);
@@ -309,4 +266,30 @@
 }
 
+/**
+  \param root the XML-element to load the LightManager's settings from
+ */
+void LightManager::loadParams(const TiXmlElement* root)
+{
+  LoadParam<LightManager>(root, "Lights", this, &LightManager::loadLights)
+      .describe("an XML-Element to load lights from.");
+
+  LoadParam<LightManager>(root, "ambient-color", this, &LightManager::setAmbientColor)
+      .describe("sets the ambient Color of the Environmental Light");
+}
+
+/**
+  \param root The XML-element to load Lights from
+ */
+void LightManager::loadLights(const TiXmlElement* root)
+{
+  const TiXmlElement* element = root->FirstChildElement();
+
+  while (element != NULL)
+  {
+    Factory::getFirst()->fabricate(element);
+
+    element = element->NextSiblingElement();
+  }
+}
 
 /**
@@ -421,32 +404,4 @@
 }
 
-
-/**
-   \brief sets The Position of the currently selected Light
-   \param position the new Position
-*/
-void LightManager::setPosition(Vector position)
-{
-  this->currentLight->setPosition(position);
-}
-
-
-/**
-   \brief Sets a Position for the currently selected Light.
-   \param x the x-coordinate
-   \param y the y-coordinate
-   \param z the z-coordinate
-*/
-void LightManager::setPosition(GLfloat x, GLfloat y, GLfloat z)
-{
-  if (!this->currentLight)
-    {
-      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
-      return;
-    }
-  this->currentLight->setPosition(x, y, z);
-}
-
-
 /**
    \brief sets an emitting Diffuse color of the currently selected Light
@@ -528,37 +483,4 @@
   this->currentLight->setSpotCutoff(cutoff);
 }
-
-
-// get Attributes
-/**
-   \returns the Position of the Light
-*/
-Vector LightManager::getPosition(void) const
-{
-  if (!this->currentLight)
-    {
-      PRINTF(2)("no Light defined yet\n");
-      return Vector(.0, .0, .0);
-    }
-  else
-    return this->currentLight->getPosition();
-}
-
-
-/**
-   \returns the Position of Light
-   \param lightNumber lightnumber
-*/
-Vector LightManager::getPosition(int lightNumber) const
-{
-  if (!this->lights[lightNumber])
-    {
-      PRINTF(2)("no Light defined yet\n");
-      return Vector(.0,.0,.0);
-    }
-  else
-    return this->lights[lightNumber]->getPosition();
-}
-
 
 /**
Index: orxonox/trunk/src/lib/graphics/light.h
===================================================================
--- orxonox/trunk/src/lib/graphics/light.h	(revision 4734)
+++ orxonox/trunk/src/lib/graphics/light.h	(revision 4735)
@@ -33,8 +33,4 @@
   void loadParams(const TiXmlElement* root);
 
-  void setPosition(const Vector& position);
-  void setPosition(GLfloat x, GLfloat y, GLfloat z);
-  Vector getPosition() const;
-
   void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
   void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
@@ -54,5 +50,4 @@
  private:
   int              lightNumber;               //!< The number of this Light.
-  GLfloat          lightPosition[4];          //!< The Position of this Light.
   GLfloat          diffuseColor[4];           //!< The Diffuse Color this Light emmits.
   GLfloat          specularColor[4];          //!< The specular Color of this Light.
@@ -115,4 +110,5 @@
 
   void loadParams(const TiXmlElement* root);
+  void loadLights(const TiXmlElement* root);
 
   // set Attributes
@@ -128,6 +124,4 @@
 
   //set Attributes
-  void setPosition(Vector position);
-  void setPosition(GLfloat x, GLfloat y, GLfloat z);
   void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
   void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
@@ -141,4 +135,5 @@
 
   Light* getLight(int lightNumber) const;
+  Light* getLight() const { return this->currentLight; };
 
   void debug(void) const;
Index: orxonox/trunk/src/story_entities/world.cc
===================================================================
--- orxonox/trunk/src/story_entities/world.cc	(revision 4734)
+++ orxonox/trunk/src/story_entities/world.cc	(revision 4735)
@@ -182,5 +182,5 @@
   delete this->nullParent;
   delete this->entities;
-  delete this->lightMan;
+  delete LightManager::getInstance();
   delete this->trackManager;
   delete this->particleEngine;
@@ -289,5 +289,5 @@
   this->particleEngine = ParticleEngine::getInstance();
   this->trackManager = TrackManager::getInstance();
-  this->lightMan = LightManager::getInstance();
+  LightManager::getInstance();
   this->nullParent = NullParent::getInstance ();
   this->nullParent->setName ("NullParent");
@@ -414,4 +414,6 @@
     //////////////////////////////
 
+    LoadParam<LightManager>(root, "LightManager", LightManager::getInstance(), &LightManager::loadParams);
+
     LoadParam<ParticleEngine>(root, "ParticleEngine", ParticleEngine::getInstance(), &ParticleEngine::loadParams);
     LoadParam<PhysicsEngine>(root, "PhysicsEngine", PhysicsEngine::getInstance(), &PhysicsEngine::loadParams);
@@ -451,15 +453,15 @@
 
 
-  lightMan->setAmbientColor(.1,.1,.1);
-  lightMan->addLight();
-  //      lightMan->setAttenuation(1.0, .01, 0.0);
-  //      lightMan->setDiffuseColor(1,1,1);
-  //  lightMan->addLight(1);
-  //  lightMan->setPosition(20, 10, -20);
-  //  lightMan->setDiffuseColor(0,0,0);
-  //lightMan->debug();
-  lightMan->setPosition(-5.0, 50.0, -40.0);
-  lightMan->addLight();
-  lightMan->setPosition(100, 80, 60);
+//   lightMan->setAmbientColor(.1,.1,.1);
+//   lightMan->addLight();
+//   //      lightMan->setAttenuation(1.0, .01, 0.0);
+//   //      lightMan->setDiffuseColor(1,1,1);
+//   //  lightMan->addLight(1);
+//   //  lightMan->setPosition(20, 10, -20);
+//   //  lightMan->setDiffuseColor(0,0,0);
+//   //lightMan->debug();
+//   lightMan->setPosition(-5.0, 50.0, -40.0);
+//   lightMan->addLight();
+//   lightMan->setPosition(100, 80, 60);
 
   //        trackManager->setBindSlave(env);
@@ -625,7 +627,7 @@
 
   // LIGHT initialisation
-  lightMan->setAmbientColor(.1,.1,.1);
-  lightMan->addLight();
-  lightMan->debug();
+  LightManager::getInstance()->setAmbientColor(.1,.1,.1);
+  LightManager::getInstance()->addLight();
+  LightManager::getInstance()->debug();
 
   switch(this->debugWorldNr)
@@ -639,5 +641,5 @@
     case DEBUG_WORLD_0:
       {
-        lightMan->setPosition(-5.0, 10.0, -40.0);
+        LightManager::getInstance()->getLight()->setAbsCoor(-5.0, 10.0, -40.0);
 
 
@@ -903,5 +905,5 @@
 
   TextEngine::getInstance()->draw();
-  lightMan->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes //
+  LightManager::getInstance()->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes //
 }
 
