Index: /orxonox/trunk/src/defs/debug.h
===================================================================
--- /orxonox/trunk/src/defs/debug.h	(revision 3596)
+++ /orxonox/trunk/src/defs/debug.h	(revision 3597)
@@ -47,5 +47,5 @@
 #define DEBUG_MODULE_ORXONOX            0
 #define DEBUG_MODULE_WORLD              0
-#define DEBUG_MODULE_PNODE              3
+#define DEBUG_MODULE_PNODE              0
 #define DEBUG_MODULE_WORLD_ENTITY       0
 #define DEBUG_MODULE_COMMAND_NODE       0
Index: /orxonox/trunk/src/light.cc
===================================================================
--- /orxonox/trunk/src/light.cc	(revision 3596)
+++ /orxonox/trunk/src/light.cc	(revision 3597)
@@ -27,15 +27,164 @@
 int lightsV[] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7};
 
-
+Light::Light(int lightNumber)
+{
+  PRINTF(4)("initializing Light number %d.\n", lightNumber);
+  // enable The light
+  glEnable(lightsV[lightNumber]); // postSpawn
+  
+  // set values (defaults)
+  this->lightNumber = lightNumber;
+  this->setPosition(0.0, 0.0, 0.0);
+  this->setDiffuseColor(1.0, 1.0, 1.0);
+  this->setSpecularColor(1.0, 1.0, 1.0);
+}
+
+Light::~Light(void)
+{
+  glDisable(lightsV[this->lightNumber]);
+}
+
+/**
+   \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(Vector position)
+{
+  this->lightPosition[0] = position.x;
+  this->lightPosition[1] = position.y;
+  this->lightPosition[2] = position.z;
+  this->lightPosition[3] = 0.0;
+
+  glLightfv (GL_LIGHT0, GL_POSITION, this->lightPosition);
+}
+
+/**
+   \brief Sets a Position for the 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->lightPosition[0] = x;
+  this->lightPosition[1] = y;
+  this->lightPosition[2] = z;
+  this->lightPosition[3] = 0.0;
+
+  glLightfv (GL_LIGHT0, GL_POSITION, this->lightPosition);
+}
+
+/**
+   \brief sets an emitting Diffuse color for the Light
+   \param r red
+   \param g green
+   \param b blue
+*/
+void Light::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  this->diffuseColor[0] = r;
+  this->diffuseColor[1] = g;
+  this->diffuseColor[2] = b;
+  this->diffuseColor[3] = 1.0;
+
+  glLightfv (GL_LIGHT0, GL_DIFFUSE, this->diffuseColor);
+}
+
+/**
+   \brief sets an emitting Ambient color for the Light
+   \param r red
+   \param g green
+   \param b blue
+*/
+void Light::setSpecularColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  this->specularColor[0] = r;
+  this->specularColor[1] = g;
+  this->specularColor[2] = b;
+  this->specularColor[3] = 1.0;
+
+  glLightfv (GL_LIGHT0, GL_SPECULAR, this->specularColor);
+}
+
+/**
+   \brief Sets the AttenuationType of this Light Source
+   \param type the AttenuationType to set
+   \param factor the Factor to multipy the attenuation with
+
+   this actually just sets the following: glLightf(currentLight, type, factor)
+*/
+void Light::setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation)
+{
+  this->constantAttenuation  = constantAttenuation;
+  this->linearAttenuation    = linearAttenuation;
+  this->quadraticAttenuation = quadraticAttenuation;
+
+  glLightf(lightsV[this->lightNumber], GL_CONSTANT_ATTENUATION,  constantAttenuation);
+  glLightf(lightsV[this->lightNumber], GL_LINEAR_ATTENUATION,    linearAttenuation);
+  glLightf(lightsV[this->lightNumber], GL_QUADRATIC_ATTENUATION, quadraticAttenuation);
+}
+
+/**
+   \brief stets the direction of the Spot Light.
+   \param direction The direction of the Spot Light.
+*/
+void Light::setSpotDirection(Vector direction)
+{
+  this->spotDirection[0] = direction.x;
+  this->spotDirection[1] = direction.y;
+  this->spotDirection[2] = direction.z;
+
+  glLightfv(lightsV[this->lightNumber], GL_SPOT_DIRECTION, this->spotDirection);
+}
+
+
+/**
+   \brief sets the cutoff angle of the Light.
+   \param cutoff The cutoff angle.
+*/
+void Light::setSpotCutoff(GLfloat cutoff)
+{
+  this->spotCutoff = cutoff;
+  glLightf(lightsV[this->lightNumber], GL_SPOT_CUTOFF, cutoff);
+}
+
+void Light::draw()
+{
+  float pos[3] = {this->getAbsCoor ().x, this->getAbsCoor().y, this->getAbsCoor().z};
+  glLightfv(lightsV[this->lightNumber], GL_POSITION, pos);
+}
+
+void Light::debug(void)
+{
+  PRINT(0)(":: %d ::  -- reference %p\n", this->lightNumber, this);
+  PRINT(0)(" GL-state: ");
+  GLboolean param; 
+  glGetBooleanv(lightsV[this->lightNumber], &param);
+  if (param)
+    PRINT(0)("ON\n");
+  else
+    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]);
+  PRINT(0)(" Attenuation: constant=%f linear=%f quadratic=%f\n", this->constantAttenuation, this->linearAttenuation, this->quadraticAttenuation);
+}
+
+
+/******************
+** LIGHT-MANAGER **
+******************/
 /**
    \brief standard constructor for a Light
 */
-Light::Light () 
-{
-  this->setClassName ("Light");
+LightManager::LightManager () 
+{
+  this->setClassName ("LightManager");
 
   glEnable (GL_LIGHTING);
   this->setAmbientColor(.3, .3, .3);
-  this->lights = new LightValue*[NUMBEROFLIGHTS];
+  this->lights = new Light*[NUMBEROFLIGHTS];
   for (int i = 0; i < NUMBEROFLIGHTS; i++)
     lights[i] = NULL;
@@ -51,12 +200,13 @@
    and in the end sets the singleton Reference to zero.
 */
-Light::~Light () 
+LightManager::~LightManager () 
 {
   glDisable(GL_LIGHTING);
   
-  for (int i = 0; i < NUMBEROFLIGHTS; i++)
-    this->deleteLight(i);
+  // this will be done either by worldEntity, or by pNode as each light is one of them
+  //  for (int i = 0; i < NUMBEROFLIGHTS; i++)
+  //    this->deleteLight(i);
   delete lights;
-  Light::singletonRef = NULL;
+  LightManager::singletonRef = NULL;
 }
 
@@ -64,15 +214,14 @@
    \brief singleton-Reference to the Light-class
 */
-Light* Light::singletonRef = NULL;
+LightManager* LightManager::singletonRef = NULL;
 
 /**
    \returns The Instance of the Lights
 */
-Light* Light::getInstance(void)
-{
-  if (singletonRef)
-    return singletonRef;
-  else
-    return Light::singletonRef = new Light();
+LightManager* LightManager::getInstance(void)
+{
+  if (!singletonRef)
+    LightManager::singletonRef = new LightManager();
+  return singletonRef;
 }
 
@@ -80,16 +229,7 @@
    \brief initializes a new Light with default values, and enables GL_LIGHTING
 */
-void Light::init(int lightNumber)
-{
-  PRINTF(3)("initializing Light number %d.\n", lightNumber);
-  // enable The light
-  glEnable(lightsV[lightNumber]);
-  this->currentLight = lights[lightNumber] = new LightValue;
-  
-  // set default values
-  this->currentLight->lightNumber = lightNumber;
-  this->setPosition(0.0, 0.0, 0.0);
-  this->setDiffuseColor(1.0, 1.0, 1.0);
-  this->setSpecularColor(1.0, 1.0, 1.0);
+void LightManager::initLight(int lightNumber)
+{
+  lights[lightNumber] = new Light(lightNumber);
 }
 
@@ -99,5 +239,5 @@
    if no slot is free error
 */
-int Light::addLight(void)
+int LightManager::addLight(void)
 {
   for (int i = 0; i < NUMBEROFLIGHTS; i++)
@@ -114,5 +254,5 @@
    if the Number is not free: warn, automatically choose another slot.
 */
-int Light::addLight(int lightNumber)
+int LightManager::addLight(int lightNumber)
 {
   if (this->lights[lightNumber])
@@ -121,5 +261,5 @@
       return this->addLight();
     }
-  this->init(lightNumber);
+  this->initLight(lightNumber);
   this->currentLight = this->lights[lightNumber];
   return lightNumber;
@@ -130,12 +270,11 @@
    \param lightNumber the light to work with
 */
-void Light::editLightNumber(int lightNumber)
+void LightManager::editLightNumber(int lightNumber)
 {
   if (!this->currentLight)
     { 
-      PRINTF(1)("no Light defined yet\n");
+      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
       return;
     }
-
   this->currentLight = lights[lightNumber];
 }
@@ -144,9 +283,9 @@
    \brief Delete the current Light
 */
-void Light::deleteLight(void)
+void LightManager::deleteLight(void)
 {
   if (!this->currentLight)
     { 
-      PRINTF(1)("no Light defined yet\n");
+      PRINTF(1)("no Light defined yet. So you cannot delete any Light right now.\n");
       return;
     }
@@ -159,11 +298,10 @@
    \param lightNumber the number of the light to delete
 */
-void Light::deleteLight(int lightNumber)
+void LightManager::deleteLight(int lightNumber)
 {
   if (this->lights[lightNumber])
     {
-      PRINTF(3)("deleting Light number %d\n", lightNumber);
+      PRINTF(4)("deleting Light number %d\n", lightNumber);
       delete this->lights[lightNumber];
-      glDisable(lightsV[lightNumber]);
       this->lights[lightNumber] = NULL;
     }
@@ -171,122 +309,4 @@
 
 // set Attributes
-/**
-   \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(Vector position)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-  this->currentLight->lightPosition[0] = position.x;
-  this->currentLight->lightPosition[1] = position.y;
-  this->currentLight->lightPosition[2] = position.z;
-  this->currentLight->lightPosition[3] = 0.0;
-
-  glLightfv (GL_LIGHT0, GL_POSITION, this->currentLight->lightPosition);
-}
-
-/**
-   \brief Sets a Position for the 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)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-
-  this->currentLight->lightPosition[0] = x;
-  this->currentLight->lightPosition[1] = y;
-  this->currentLight->lightPosition[2] = z;
-  this->currentLight->lightPosition[3] = 0.0;
-
-  glLightfv (GL_LIGHT0, GL_POSITION, this->currentLight->lightPosition);
-}
-
-/**
-   \brief sets an emitting Diffuse color for the Light
-   \param r red
-   \param g green
-   \param b blue
-*/
-void Light::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-
-  this->currentLight->diffuseColor[0] = r;
-  this->currentLight->diffuseColor[1] = g;
-  this->currentLight->diffuseColor[2] = b;
-  this->currentLight->diffuseColor[3] = 1.0;
-
-  glLightfv (GL_LIGHT0, GL_DIFFUSE, this->currentLight->diffuseColor);
-}
-
-
-/**
-   \brief sets an emitting Ambient color for the Light
-   \param r red
-   \param g green
-   \param b blue
-*/
-void Light::setSpecularColor(GLfloat r, GLfloat g, GLfloat b)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-
-  this->currentLight->specularColor[0] = r;
-  this->currentLight->specularColor[1] = g;
-  this->currentLight->specularColor[2] = b;
-  this->currentLight->specularColor[3] = 1.0;
-
-  glLightfv (GL_LIGHT0, GL_SPECULAR, this->currentLight->specularColor);
-}
-
-/**
-   \brief Sets the AttenuationType of this Light Source
-   \param type the AttenuationType to set
-   \param factor the Factor to multipy the attenuation with
-
-   this actually just sets the following: glLightf(currentLight, type, factor)
-*/
-void Light::setAttenuation(AttenuationType type, float factor)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-  this->currentLight->attenuationFactor = factor;
-  this->currentLight->attenuationType = type;
-  switch (type)
-    {
-    case CONSTANT:
-      glLightf(lightsV[this->currentLight->lightNumber], GL_CONSTANT_ATTENUATION, factor);
-      break;
-    case LINEAR:
-      glLightf(lightsV[this->currentLight->lightNumber], GL_LINEAR_ATTENUATION, factor);
-      break;
-    case QUADRATIC:
-      glLightf(lightsV[this->currentLight->lightNumber], GL_QUADRATIC_ATTENUATION, factor);
-      break;
-    }
-}
-
-
 /**
    \brief sets the ambient Color of the Scene
@@ -295,5 +315,5 @@
    \param b blue
 */
-void Light::setAmbientColor(GLfloat r, GLfloat g, GLfloat b)
+void LightManager::setAmbientColor(GLfloat r, GLfloat g, GLfloat b)
 {
   this->ambientColor[0] = r;
@@ -305,35 +325,38 @@
 }
 
-/**
-   \brief stets the direction of the Spot Light.
-   \param direction The direction of the Spot Light.
-*/
-void Light::setSpotDirection(Vector direction)
-{
-  this->currentLight->spotDirection[0] = direction.x;
-  this->currentLight->spotDirection[1] = direction.y;
-  this->currentLight->spotDirection[2] = direction.z;
-
-  glLightfv(lightsV[this->currentLight->lightNumber], GL_SPOT_DIRECTION, this->currentLight->spotDirection);
-}
-
-
-/**
-   \brief sets the cutoff angle of the Light.
-   \param cutoff The cutoff angle.
-*/
-void Light::setSpotCutoff(GLfloat cutoff)
-{
-  this->currentLight->spotCutoff = cutoff;
-  glLightf(lightsV[this->currentLight->lightNumber], GL_SPOT_CUTOFF, cutoff);
-}
-
+void LightManager::setPosition(Vector position)
+{
+  this->currentLight->setPosition(position);
+}
+void LightManager::setPosition(GLfloat x, GLfloat y, GLfloat z)
+{
+  this->currentLight->setPosition(x, y, z);
+}
+void LightManager::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  this->currentLight->setDiffuseColor(r,g,b);
+}
+void LightManager::setSpecularColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  this->currentLight->setSpecularColor(r, g, b);
+}
+void LightManager::setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation)
+{
+  this->currentLight->setAttenuation(constantAttenuation, linearAttenuation, quadraticAttenuation);
+}
+void LightManager::setSpotDirection(Vector direction)
+{
+  this->currentLight->setSpotDirection(direction);
+}
+void LightManager::setSpotCutoff(GLfloat cutoff)
+{
+  this->currentLight->setSpotCutoff(cutoff);
+}
 
 // get Attributes
-
 /**
    \returns the Position of the Light
 */
-Vector Light::getPosition(void)
+Vector LightManager::getPosition(void)
 {
   if (!this->currentLight)
@@ -346,16 +369,13 @@
 }
 
-
-
-
 /**
    \brief outputs debug information about the Class and its lights
 */
-void Light::debug(void)
+void LightManager::debug(void)
 {
   PRINT(0)("=================================\n");
   PRINT(0)("= DEBUG INFORMATION CLASS LIGHT =\n");
   PRINT(0)("=================================\n");
-  PRINT(0)("Reference: %p\n", Light::singletonRef);
+  PRINT(0)("Reference: %p\n", LightManager::singletonRef);
   if (this->currentLight)
     PRINT(0)("current Light Nr: %d\n", this->currentLight->lightNumber);
@@ -365,31 +385,5 @@
     if (this->lights[i])
       {
-	PRINT(0)(":: %d ::  -- reference %p\n", i, lights[i]);
-	PRINT(0)(" GL-state: ");
-	GLboolean param; 
-	glGetBooleanv(lightsV[i], &param);
-	if (param)
-	  PRINT(0)("ON\n");
-	else
-	  PRINT(0)("OFF\n");
-
-	if (i != lights[i]->lightNumber)
-	  PRINTF(1)(" Lights are out of sync, this really should not happen,\n   %d % should be equal.\n", i, lights[i]->lightNumber);
-	PRINT(0)(" Position:      %f/%f/%f\n", lights[i]->lightPosition[0], lights[i]->lightPosition[1], lights[i]->lightPosition[2]);
-	PRINT(0)(" DiffuseColor:  %f/%f/%f\n", lights[i]->diffuseColor[0], lights[i]->diffuseColor[1], lights[i]->diffuseColor[2]);
-	PRINT(0)(" SpecularColor: %f/%f/%f\n", lights[i]->specularColor[0], lights[i]->specularColor[1], lights[i]->specularColor[2]);
-	PRINT(0)(" Attenuation:   ");
-	switch (lights[i]->attenuationType)
-	  {
-	  case CONSTANT:
-	    PRINT(0)("constant");
-	  case LINEAR:
-	    PRINT(0)("linear");
-	    break;
-	  case QUADRATIC:
-	    PRINT(0)("quadratic");
-	    break;
-	  }
-	PRINT(0)(" with Factor %f\n", lights[i]->attenuationFactor);
+	this->lights[i]->debug();
       }
   PRINT(0)("--------------------------------\n");
Index: /orxonox/trunk/src/light.h
===================================================================
--- /orxonox/trunk/src/light.h	(revision 3596)
+++ /orxonox/trunk/src/light.h	(revision 3597)
@@ -17,14 +17,38 @@
 #define NUMBEROFLIGHTS GL_MAX_LIGHTS
 
-//! Enumerator for the attenuation-Type.
-/**
-   CONSTANT means GL_CONSTANT_ATTENUATION
-   LINEAR means   GL_LINEAR_ATTENUATION
-   QUADRATIC means GL_QUADRATIC_ATTENUATION
-*/
-enum AttenuationType {CONSTANT, LINEAR, QUADRATIC};
-
 // FORWARD DEFINITIONS //
 class Vector;
+
+//! A struct that holds information about a Light
+class Light : public WorldEntity
+{
+ public:
+  Light(int lightNumber);
+  ~Light(void);
+
+  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);
+  void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
+  void setSpotDirection(Vector direction);
+  void setSpotCutoff(GLfloat cutoff);
+
+  virtual void draw();
+
+  // attributes
+
+  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.
+  float constantAttenuation;  //!< The Factor of the the Constant Attenuation.
+  float linearAttenuation;    //!< The Factor of the the Linear Attenuation.
+  float quadraticAttenuation; //!< The Factor of the the Quadratic Attenuation.
+  GLfloat spotDirection[4];   //!< The direction of the Spot Light.
+  GLfloat spotCutoff;         //!< The cutoff Angle of the Light Source
+
+  void debug(void);
+};
 
 //! A class that handles Lights
@@ -32,33 +56,19 @@
    A Light is a source that emits light rays (photons)
 */
-class Light : public BaseObject
+class LightManager : public BaseObject
 {
  private:
-  //! A struct that holds information about a Light
-  struct LightValue
-  {
-    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.
-    AttenuationType attenuationType;//!< The AttenuationType of this Light.
-    float attenuationFactor;    //!< The Factor the attenuation should have.
-    GLfloat spotDirection[4];   //!< The direction of the Spot Light.
-    GLfloat spotCutoff;         //!< The cutoff Angle of the Light Source
-  };
-
-  static Light* singletonRef;    //!< This is the LightHandlers Reference.
+  LightManager(void);
+  void initLight(int LightNumber);
+  
+  static LightManager* singletonRef;    //!< This is the LightHandlers Reference.
   GLfloat ambientColor[4];       //!< The ambient Color of the scene.
 
-
-  Light(void);
-
-  void init(int LightNumber);  
-  LightValue** lights;           //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues.
-  LightValue* currentLight;      //!< The current Light, we are working with.
+  Light** lights;                //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues.
+  Light* currentLight;           //!< The current Light, we are working with.
   
  public:
-  static Light* getInstance();
-  virtual ~Light(void);
+  static LightManager* getInstance();
+  virtual ~LightManager(void);
 
   // set Attributes
@@ -69,10 +79,12 @@
   void deleteLight(int lightNumber);
 
+  void setAmbientColor(GLfloat r, GLfloat g, GLfloat b);
+
+  //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);
-  void setAttenuation(AttenuationType type, float factor);
-  void setAmbientColor(GLfloat r, GLfloat g, GLfloat b);
+  void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
   void setSpotDirection(Vector direction);
   void setSpotCutoff(GLfloat cutoff);
Index: /orxonox/trunk/src/story_entities/world.cc
===================================================================
--- /orxonox/trunk/src/story_entities/world.cc	(revision 3596)
+++ /orxonox/trunk/src/story_entities/world.cc	(revision 3597)
@@ -73,5 +73,5 @@
   delete this->nullParent;
   delete this->entities;
-  delete this->light;
+  delete this->lightMan;
   delete this->trackManager;
 }
@@ -297,16 +297,14 @@
   this->spawn(terrain);
   // LIGHT initialisation
-  light = Light::getInstance();
-  light->setAmbientColor(.1,.1,.1);
-  light->addLight();
-  light->setAttenuation(QUADRATIC, 1.0);
-  light->setAttenuation(CONSTANT, 2.0);
-  light->setAttenuation(QUADRATIC, 1.0);
-  light->setPosition(10.0, 30.0, 10.0);
-  light->setDiffuseColor(1,1,1);
-  //  light->addLight(1);
-  //  light->setPosition(20, 10, -20);
-  //  light->setDiffuseColor(0,0,0);
-  light->debug();
+  lightMan = LightManager::getInstance();
+  lightMan->setAmbientColor(.1,.1,.1);
+  lightMan->addLight();
+  lightMan->setPosition(10.0, 30.0, 10.0);
+  lightMan->setAttenuation(1.0, 0, 0);
+  lightMan->setDiffuseColor(1,1,1);
+  //  lightMan->addLight(1);
+  //  lightMan->setPosition(20, 10, -20);
+  //  lightMan->setDiffuseColor(0,0,0);
+  lightMan->debug();
 
 
Index: /orxonox/trunk/src/story_entities/world.h
===================================================================
--- /orxonox/trunk/src/story_entities/world.h	(revision 3596)
+++ /orxonox/trunk/src/story_entities/world.h	(revision 3597)
@@ -17,5 +17,5 @@
 class GLMenuImageScreen;
 class Skysphere;
-class Light;
+class LightManager;
 class FontSet;
 class Terrain;
@@ -72,8 +72,8 @@
 
   PNode* nullParent;            //!< The zero-point, that everything has as its parent.
-  TrackManager* trackManager;  //!< The reference of the TrackManager that handles the course through the Level.
-  Camera* localCamera;         //!< The current Camera
+  TrackManager* trackManager;   //!< The reference of the TrackManager that handles the course through the Level.
+  Camera* localCamera;          //!< The current Camera
   Skysphere* skySphere;         //!< The Environmental Heaven of orxonox \todo insert this to environment insted
-  Light* light;                 //!< The Lights of the Level
+  LightManager* lightMan;       //!< The Lights of the Level
   Terrain* terrain;             //!< The Terrain of the World.
 
