Index: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	(revision 10351)
+++ trunk/ChangeLog	(revision 10368)
@@ -1,2 +1,34 @@
+2006-12-17 Nicolas Schlumberger <nicolasc@ee.ethz.ch>
+  Added guiding sysmte for swarm missile
+  updated drawing function, to draw in the correct direction
+
+2006-12-16  Marc Schärer <marcscha@ee.ethz.ch>
+  Addition trail system
+  Experiment with explosion class on SpaceShip.
+  Sadly, collision problems still persist. need to be solved until wednesday 2006-12-20
+
+2006-12-03  Nicolas Schlumberger <nicolasc@ee.ethz.ch>
+  Added Rotation to hbolt
+  Did some experimenting with test_entity2 (rotation, texturing)
+  Added textured versions of bolt, and hbolt
+
+2006-12-03  Marc Schärer <marcscha@ee.ethz.ch>
+  Added functionality to show / hide a crosshair to the weapon manager. No default crosshair anymore
+  Multiple weapons per ship added
+  Several small tweaks needed to make the above working added
+  Addition of SwarmMissile and SwarmProjectile
+
+2006-11-29  Nicolas Schlumbgerger <nicolasc@ee.ethz.ch>
+  Added bolt projectile for light blaster, copied of laser
+  Added hbolt projectile for heavy blaster, copied of laser
+  Added bolt model, currently untextured
+  Added hbolt model, currently untextured
+
+2006-11-28	Marc Schärer <marcscha@ee.ethz.ch>
+	Mapped primary weapon manager back to playable default weapon manager.
+        Addition of secondary weapon manager for special weapon. Currently uses Cannon to show and test this functionality.
+	Implementation of weapon energy regeneration. This needed some little modifications to the HUD class as well but now works :)
+	Addition of the second weapon manager to the HUD manager in util/hud .h .cc for our master of HUD ;-)
+
 2006-09-22	Benjamin Grauer <bensch@orxonox.net>
 	Complete reimplementation of the ResourceManager.
Index: trunk/src/lib/coord/p_node.h
===================================================================
--- trunk/src/lib/coord/p_node.h	(revision 10351)
+++ trunk/src/lib/coord/p_node.h	(revision 10368)
@@ -98,5 +98,5 @@
   inline const Vector& getRelCoor () const { return this->prevRelCoordinate; };
   /** @returns the Relative Coordinate Destination */
-inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)? *this->toCoordinate : this->relCoordinate; };
+  inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)? *this->toCoordinate : this->relCoordinate; };
   void setAbsCoor (const Vector& absCoord);
   void setAbsCoor (float x, float y, float z);
@@ -133,5 +133,5 @@
   inline const Quaternion& getRelDir () const { return this->prevRelDirection; };
   /** @returns the Relative Directional Destination */
-inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)? *this->toDirection : this->relDirection; };
+  inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)? *this->toDirection : this->relDirection; };
   /** @returns a Vector pointing into the relative Direction */
   inline Vector getRelDirV() const { return this->prevRelDirection.apply(Vector(0,1,0)); };
Index: trunk/src/lib/graphics/importer/vertex_array_model.cc
===================================================================
--- trunk/src/lib/graphics/importer/vertex_array_model.cc	(revision 10351)
+++ trunk/src/lib/graphics/importer/vertex_array_model.cc	(revision 10368)
@@ -260,5 +260,5 @@
                             ((float)j - (float)resolutionY/2.0)/(float)resolutionY * sizeY);
           this->addNormal(0.0, 1, 0.0);
-          this->addTexCoor((float)i/(float)resolutionX, (float)j/(float)resolutionY);
+          this->addTexCoor((float)i/(float)(resolutionY-1), (float)j/(float)(resolutionX-1));
           this->addColor(1.0, 1.0, 1.0);
         }
Index: trunk/src/lib/gui/gl/glgui_bar.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_bar.cc	(revision 10351)
+++ trunk/src/lib/gui/gl/glgui_bar.cc	(revision 10368)
@@ -71,5 +71,5 @@
 
     this->_value = value;
-    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value -_minimum)/ (_minimum + _maximum)
+    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum)
         ,this->getSizeY2D() - borderTop() - borderBottom());
   }
@@ -99,6 +99,6 @@
 
     this->_frontRect.setTopLeft(borderLeft(), borderTop());
-    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value -_minimum)/ (_minimum + _maximum)
-                             ,this->getSizeY2D() - borderTop() - borderBottom());
+    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum)
+        ,this->getSizeY2D() - borderTop() - borderBottom());
 
   }
Index: trunk/src/lib/gui/gl/glgui_box.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_box.cc	(revision 10351)
+++ trunk/src/lib/gui/gl/glgui_box.cc	(revision 10368)
@@ -18,5 +18,8 @@
 #include "glgui_box.h"
 #include <cassert>
+#include <iostream>
 #include "debug.h"
+#include "network_log.h"
+
 
 namespace OrxGui
@@ -177,5 +180,5 @@
   void GLGuiBox::resize()
   {
-    if (orientation() == OrxGui::Vertical)
+    if (this->orientation() == OrxGui::Vertical)
     {
       float height = borderTop();
@@ -186,7 +189,27 @@
       for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
       {
-        (*widget)->setRelCoor2D(borderLeft(), height);
-        height += (*widget)->getSizeY2D();
-        width = fmax(width, (*widget)->getSizeX2D());
+        //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
+        //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir));
+        //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir));
+        float realSizeX, realSizeY;
+        int angleAbs = (int)(*widget)->getAbsDir2D();
+        int angleRel = (int)(*widget)->getRelDir2D();
+        //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n';
+        if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180)
+        {
+          realSizeX = (*widget)->getSizeX2D();
+          realSizeY = (*widget)->getSizeY2D();
+          //std::cout<<"box vertical, widget 0or180";
+        }
+        else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270)
+        {
+          realSizeX = (*widget)->getSizeY2D();
+          realSizeY = (*widget)->getSizeX2D();
+          //std::cout<<"box vertical, widget 90or270";
+        }
+
+        (*widget)->setRelCoor2D(borderLeft(), height + borderTop());
+        height += realSizeY;
+        width = fmax(width, realSizeX);
       }
 
@@ -205,7 +228,28 @@
       for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
       {
+        //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
+        //std::cout << "size X: " << (*widget)->getSizeX2D() << "size Y: " << (*widget)->getSizeY2D() << '\n';
+        //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir));
+        //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir));
+        float realSizeX, realSizeY;
+        int angleAbs = (int)(*widget)->getAbsDir2D();
+        int angleRel = (int)(*widget)->getRelDir2D();
+        //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n';
+        if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180)
+        {
+          realSizeX = (*widget)->getSizeX2D();
+          realSizeY = (*widget)->getSizeY2D();
+          //std::cout<<"box horicontal, widget 0or180";
+        }
+        else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270)
+        {
+          realSizeX = (*widget)->getSizeY2D();
+          realSizeY = (*widget)->getSizeX2D();
+          //std::cout<<"box horicontal, widget 90or270";
+        }
+
         (*widget)->setRelCoor2D(width, borderTop());
-        height = fmax(height, (*widget)->getSizeY2D());
-        width += (*widget)->getSizeX2D();
+        height = fmax(height, realSizeY);
+        width += realSizeX;
       }
 
Index: trunk/src/lib/gui/gl/glgui_widget.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_widget.cc	(revision 10351)
+++ trunk/src/lib/gui/gl/glgui_widget.cc	(revision 10368)
@@ -915,4 +915,11 @@
   }
 
+  void GLGuiWidget::beginDraw() const 
+  { 
+    glPushMatrix(); 
+    glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
+    glRotatef(this->getAbsDir2D(), 0, 0, 1);
+  }
+
 
 }
Index: trunk/src/lib/gui/gl/glgui_widget.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_widget.h	(revision 10351)
+++ trunk/src/lib/gui/gl/glgui_widget.h	(revision 10368)
@@ -244,5 +244,5 @@
 
     /// RENDERING
-    inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };
+    void beginDraw() const;
     inline void endDraw() const { glPopMatrix(); };
 
Index: trunk/src/lib/math/curve.cc
===================================================================
--- trunk/src/lib/math/curve.cc	(revision 10351)
+++ trunk/src/lib/math/curve.cc	(revision 10368)
@@ -142,4 +142,19 @@
     tmpNode = tmpNode->next;
   return tmpNode->position;
+}
+
+/**
+ * This function returns an approximation of the length of the curve
+ *
+*/
+float Curve::getLength()
+{
+      float length = 0;
+      PathNode* tmpNode = this->firstNode;
+      for(int i = 1; i < this->nodeCount; i++)
+      {
+              length += Vector(tmpNode->next->position - tmpNode->position).len();
+      }
+      return length;
 }
 
@@ -273,5 +288,6 @@
 Vector BezierCurve::calcDir (float t)
 {
-  return this->dirCurve->calcPos(t);
+  return this->calcPos(t + 0.01) - this->calcPos(t);
+  //return this->dirCurve->calcPos(t);
 }
 
Index: trunk/src/lib/math/curve.h
===================================================================
--- trunk/src/lib/math/curve.h	(revision 10351)
+++ trunk/src/lib/math/curve.h	(revision 10368)
@@ -47,4 +47,5 @@
   /** @returns the directional Curve */
   Curve* getDirCurve() const { return this->dirCurve; };
+  float getLength();
 
   /** @param t the value on the curve [0-1] @returns Vector to the position */
Index: trunk/src/lib/math/spline.cc
===================================================================
--- trunk/src/lib/math/spline.cc	(revision 10368)
+++ trunk/src/lib/math/spline.cc	(revision 10368)
@@ -0,0 +1,186 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    $RCSfile: Spline.cxx,v $
+
+  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+  All rights reserved.
+  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notice for more information.
+
+=========================================================================*/
+#include "spline.h"
+
+
+//----------------------------------------------------------------------------
+// Construct a spline wth the folloing defaults:
+// ClampValueOff
+Spline::Spline ()
+{
+  this->ComputeTime = 0;
+  this->ClampValue = 0;
+  this->PiecewiseFunction = vtkPiecewiseFunction::New();
+  this->Intervals = NULL;
+  this->Coefficients = NULL;
+  this->LeftConstraint = 1;
+  this->LeftValue = 0.0;
+  this->RightConstraint = 1;
+  this->RightValue = 0.0;
+  this->Closed = 0;
+
+  this->ParametricRange[0] = -1;
+  this->ParametricRange[1] = -1;
+}
+
+//----------------------------------------------------------------------------
+Spline::~Spline ()
+{
+  this->PiecewiseFunction->Delete();
+  if (this->Coefficients)
+  {
+    delete [] this->Coefficients;
+  }
+  if (this->Intervals)
+  {
+    delete [] this->Intervals;
+  }
+}
+
+//----------------------------------------------------------------------------
+void Spline::SetParametricRange(double tMin, double tMax)
+{
+  if ( tMin != this->ParametricRange[0] || tMax != this->ParametricRange[1] )
+  {
+    if ( tMin >= tMax )
+    {
+      tMax = tMin + 1;
+    }
+
+    this->ParametricRange[0] = tMin;
+    this->ParametricRange[1] = tMax;
+
+    this->Modified();
+  }
+}
+
+//----------------------------------------------------------------------------
+void Spline::GetParametricRange(double tRange[2]) const
+{
+  if ( this->ParametricRange[0] != this->ParametricRange[1] )
+  {
+    tRange[0] = this->ParametricRange[0];
+    tRange[1] = this->ParametricRange[1];
+  }
+  else
+  {
+    tRange[0] = this->PiecewiseFunction->GetRange()[0];
+    tRange[1] = this->PiecewiseFunction->GetRange()[1];
+  }
+}
+
+//----------------------------------------------------------------------------
+double Spline::ComputeLeftDerivative()
+{
+  double *dptr = this->PiecewiseFunction->GetDataPointer();
+  int size = this->PiecewiseFunction->GetSize();
+  if ( dptr == NULL || size < 2 )
+  {
+    return 0.0;
+  }
+  else
+  {
+    return (dptr[2]-dptr[0]);
+  }
+}
+
+//----------------------------------------------------------------------------
+double Spline::ComputeRightDerivative()
+{
+  double *dptr = this->PiecewiseFunction->GetDataPointer();
+  int size = this->PiecewiseFunction->GetSize();
+  if ( dptr == NULL || size < 2 )
+  {
+    return 0.0;
+  }
+  else
+  {
+    return (dptr[(size-1)*2]-dptr[(size-2)*2]);
+  }
+}
+
+//----------------------------------------------------------------------------
+int Spline::GetNumberOfPoints()
+{
+  return this->PiecewiseFunction->GetSize();
+}
+
+
+//----------------------------------------------------------------------------
+// Add a point to the Piecewise Functions containing the data
+void Spline::AddPoint (double t, double x)
+{
+  if ( this->ParametricRange[0] != this->ParametricRange[1] )
+  {
+    t = (t < this->ParametricRange[0] ? this->ParametricRange[0] :
+         (t > this->ParametricRange[1] ? this->ParametricRange[1] : t));
+  }
+  this->PiecewiseFunction->AddPoint (t, x);
+}
+
+//----------------------------------------------------------------------------
+// Remove a point from the Piecewise Functions.
+void Spline::RemovePoint (double t)
+{
+  if ( this->ParametricRange[0] != this->ParametricRange[1] )
+  {
+    t = (t < this->ParametricRange[0] ? this->ParametricRange[0] :
+         (t > this->ParametricRange[1] ? this->ParametricRange[1] : t));
+  }
+  this->PiecewiseFunction->RemovePoint (t);
+}
+
+//----------------------------------------------------------------------------
+// Remove all points from the Piecewise Functions.
+void Spline::RemoveAllPoints ()
+{
+  this->PiecewiseFunction->RemoveAllPoints ();
+}
+
+
+
+
+
+//----------------------------------------------------------------------------
+int Spline::FindIndex(int size, double t)
+{
+  int index=0;
+  if ( size > 2 ) //bisection method for speed
+  {
+    int rightIdx = size - 1;
+    int centerIdx = rightIdx - size/2;
+    for (int converged=0; !converged; )
+    {
+      if ( this->Intervals[index] <= t && t <= this->Intervals[centerIdx] )
+      {
+        rightIdx = centerIdx;
+      }
+      else //if ( this->Intervals[centerIdx] < t && t <= this->Intervals[rightIdx] )
+      {
+        index = centerIdx;
+      }
+      if ( (index + 1) == rightIdx )
+      {
+        converged = 1;
+      }
+      else
+      {
+        centerIdx = index + (rightIdx-index)/2;
+      }
+    }//while not converged
+  }
+  return index;
+}
+
Index: trunk/src/lib/math/spline.h
===================================================================
--- trunk/src/lib/math/spline.h	(revision 10368)
+++ trunk/src/lib/math/spline.h	(revision 10368)
@@ -0,0 +1,102 @@
+
+#ifndef __Spline_h
+#define __Spline_h
+
+#include "vtkObject.h"
+
+class Spline
+{
+public:
+
+  // Description:
+  // Set/Get the parametric range. If not set, the range is determined
+  // implicitly by keeping track of the (min,max) parameter values for
+  // t. If set, the AddPoint() method will clamp the t value to lie
+  // within the specified range.
+  void SetParametricRange(double tMin, double tMax);
+  void SetParametricRange(double tRange[2])
+    {this->SetParametricRange(tRange[0],tRange[1]);}
+  void GetParametricRange(double tRange[2]) const;
+
+
+  // Description:
+  // Compute the coefficients for the spline.
+  virtual void Compute () = 0;
+
+  // Description:
+  // Interpolate the value of the spline at parametric location of t.
+  virtual double Evaluate (double t) = 0;
+
+  // Description:
+  // Return the number of points inserted thus far.
+  int GetNumberOfPoints();
+
+  // Description:
+  // Add a pair of points to be fit with the spline.
+  void AddPoint (double t, double x);
+
+  // Description:
+  // Remove a point from the data to be fit with the spline.
+  void RemovePoint (double t);
+
+  // Description:
+  // Remove all points from the data.
+  void RemoveAllPoints ();
+
+
+
+protected:
+  Spline();
+  ~Spline();
+
+  unsigned long ComputeTime;
+  // Description:
+  // Set/Get ClampValue. If On, results of the interpolation will be
+  // clamped to the min/max of the input data.
+  int ClampValue;
+  double *Intervals;
+  double *Coefficients;
+  int LeftConstraint;
+  // Description:
+  // The values of the derivative on the left and right sides. The value
+  // is used only if the left(right) constraint is type 1-3.
+  double LeftValue;
+  // Description:
+  // Set the type of constraint of the left(right) end points. Four
+  // constraints are available:
+  //
+  // 0: the first derivative at left(right) most point is determined
+  // from the line defined from the first(last) two points.
+  //
+  // 1: the first derivative at left(right) most point is set to
+  // Left(Right)Value.
+  //
+  // 2: the second derivative at left(right) most point is set to
+  // Left(Right)Value.
+  //
+  // 3: the second derivative at left(right)most points is Left(Right)Value
+  // times second derivative at first interior point.
+  int RightConstraint;
+  double RightValue;
+  vtkPiecewiseFunction *PiecewiseFunction;
+  // Description:
+  // Control whether the spline is open or closed. A closed spline forms
+  // a continuous loop: the first and last points are the same, and
+  // derivatives are continuous.
+
+  int Closed;
+
+  // Explicitly specify the parametric range.
+  double ParametricRange[2];
+
+  // Helper methods
+  double ComputeLeftDerivative();
+  double ComputeRightDerivative();
+  int FindIndex(int size, double t);
+
+private:
+  Spline(const Spline&);  // Not implemented.
+  void operator=(const Spline&);  // Not implemented.
+};
+
+#endif
Index: trunk/src/lib/util/loading/fast_factory.cc
===================================================================
--- trunk/src/lib/util/loading/fast_factory.cc	(revision 10351)
+++ trunk/src/lib/util/loading/fast_factory.cc	(revision 10368)
@@ -157,4 +157,5 @@
 void FastFactory::flush(bool hardFLUSH)
 {
+hardFLUSH = false; // HACK
   FastObjectMember* tmpMember = this->deadList, *delMember = NULL;
   while (tmpMember != NULL)
Index: trunk/src/story_entities/game_world.cc
===================================================================
--- trunk/src/story_entities/game_world.cc	(revision 10351)
+++ trunk/src/story_entities/game_world.cc	(revision 10368)
@@ -359,9 +359,9 @@
       this->dataTank->localPlayer->getPlayable()->setPlaymode(playmode))
   {
-    PRINTF(4)("Set Playmode to %d:%s\n", playmode, Playable::playmodeToString(playmode).c_str());
+    PRINTF(0)("Set Playmode to %d:%s\n", playmode, Playable::playmodeToString(playmode).c_str());
   }
   else
   {
-    PRINTF(2)("Unable to set Playmode %d:'%s'\n", playmode, Playable::playmodeToString(playmode).c_str());
+    PRINTF(0)("Unable to set Playmode %d:'%s'\n", playmode, Playable::playmodeToString(playmode).c_str());
   }
 }
Index: trunk/src/story_entities/menu/game_menu.cc
===================================================================
--- trunk/src/story_entities/menu/game_menu.cc	(revision 10351)
+++ trunk/src/story_entities/menu/game_menu.cc	(revision 10368)
@@ -111,4 +111,5 @@
 
   this->dataTank->localCamera->setRelCoor(this->cameraVector);
+  //this->dataTank->localCamera->setFovy(60);
 
   GraphicsEngine::getInstance()->displayFPS(false);
Index: trunk/src/util/Makefile.am
===================================================================
--- trunk/src/util/Makefile.am	(revision 10351)
+++ trunk/src/util/Makefile.am	(revision 10368)
@@ -26,7 +26,7 @@
 			animation/animation_player.cc \
 			\
-			track/pilot_node.cc
-
-#			track/track_manager.cc \
+			track/pilot_node.cc \
+			track/track.cc \
+			track/track_manager.cc \
 			track/track_node.cc
 
@@ -52,6 +52,7 @@
 			animation/t_animation.h \
 			\
-			track/pilot_node.h
+			track/pilot_node.h \
+			track/track.h \
+			track/track_manager.h \
+			track/track_node.h
 
-#			track/track_manager.h \
-			track/track_node.h
Index: trunk/src/util/hud.cc
===================================================================
--- trunk/src/util/hud.cc	(revision 10351)
+++ trunk/src/util/hud.cc	(revision 10368)
@@ -23,8 +23,12 @@
 #include "world_entities/weapons/weapon_manager.h"
 #include "glgui_widget.h"
+#include "glgui_box.h"
+#include "glgui_bar.h"
+#include "elements/glgui_energywidgetvertical.h"
 
 #include "glgui_inputline.h"
 #include "specials/glgui_notifier.h"
 #include "elements/glgui_radar.h"
+#include "world_entities/space_ships/space_ship.h"
 
 
@@ -45,9 +49,17 @@
   //this->setSize2D(
   this->weaponManager = NULL;
+  this->weaponManagerSecondary = NULL;
   this->energyWidget = NULL;
   this->shieldWidget = NULL;
   this->armorWidget = NULL;
+  //this->leftRect = NULL;
+  //this->rightRect = NULL;
   this->resX = 1;
   this->resY = 1;
+
+  this->overlayPercentage = 40;
+  this->overlayActive = false;
+  this->rightRect = new OrxGui::GLGuiImage();
+  this->leftRect = new OrxGui::GLGuiImage();
 
   this->inputLine = new OrxGui::GLGuiInputLine();
@@ -58,9 +70,10 @@
 
   this->_radar = new OrxGui::GLGuiRadar();
+  this->radarCenterNode = NULL;
 
   this->subscribeEvent(ES_ALL, EV_VIDEO_RESIZE);
   this->subscribeEvent(ES_ALL, SDLK_TAB);
 
-
+  //this->shipValuesBox = NULL;
 }
 
@@ -75,4 +88,9 @@
 
   delete this->_radar;
+  delete this->rightRect;
+  delete this->leftRect;
+  //if (this->shipValuesBox != NULL)
+    //delete this->shipValuesBox;
+
   // delete what has to be deleted here
 }
@@ -94,4 +112,7 @@
 void Hud::setEnergyWidget(OrxGui::GLGuiWidget* widget)
 {
+  //if (this->shipValuesBox == NULL)
+    //this->createShipValuesBox();
+
   // decopple old widget
   if (this->energyWidget != NULL)
@@ -103,6 +124,10 @@
   if (this->energyWidget != NULL)
   {
+    //this->energyWidget->shiftDir2D(270);
+    //dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->energyWidget)->setDisplayedName("Electronics");
+    //this->shipValuesBox->pack(this->energyWidget);
+    //dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->energyWidget)->setStandardSettings();
+    this->energyWidget->setParent2D(this->leftRect);
     this->energyWidget->show();
-    this->energyWidget->setBackgroundTexture( "hud_energy_background.png");
     /*    this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
         this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
@@ -113,11 +138,66 @@
 
 void Hud::setShiledWidget(OrxGui::GLGuiWidget* widget)
-{}
+{
+  /*
+  if (this->shipValuesBox == NULL)
+    this->createShipValuesBox();
+  */
+
+  // decopple old widget
+  if (this->shieldWidget != NULL)
+  {
+    this->shieldWidget->hide();
+  }
+
+  this->shieldWidget = widget;
+  if (this->shieldWidget != NULL)
+  {
+    //this->shieldWidget->shiftDir2D(270);
+    //this->shipValuesBox->pack(this->shieldWidget);
+    //dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->shieldWidget)->setStandardSettings();
+    this->shieldWidget->setParent2D(this->leftRect);
+    this->shieldWidget->show();
+    /*    this->shieldWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
+        this->shieldWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
+  }
+  else
+    printf("schild im hud nicht uebergeben!!!!!!!!!!!!!!!!!!!!!!!!!");
+
+  this->updateResolution();
+}
 
 void Hud::setArmorWidget(OrxGui::GLGuiWidget* widget)
-{}
-
-void Hud::setWeaponManager(WeaponManager* weaponMan)
-{
+{
+  /*
+  if (this->shipValuesBox == NULL)
+    this->createShipValuesBox();
+  */
+
+// decopple old widget
+  if (this->armorWidget != NULL)
+  {
+    this->armorWidget->hide();
+  }
+
+  this->armorWidget = widget;
+  if (this->armorWidget != NULL)
+  {
+    //this->armorWidget->shiftDir2D(270);
+    //this->shipValuesBox->pack(this->armorWidget);
+    //dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->armorWidget)->setStandardSettings();
+    this->armorWidget->setParent2D(this->leftRect);
+    this->armorWidget->show();
+    /*    this->armorWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
+        this->armorWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
+  }
+
+  this->updateResolution();
+}
+
+void Hud::setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec)
+{
+  //clearWeaponManager();
+
+  //Hide all widgets
   if (this->weaponManager != NULL)
   {
@@ -128,10 +208,24 @@
       {
         weapon->getEnergyWidget()->hide();
-        this->weaponsWidgets.remove(weapon->getEnergyWidget());
+        //this->weaponsWidgetsPrim.remove(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (weapon->getEnergyWidget()));
       }
     }
   }
 
+  if (this->weaponManagerSecondary != NULL)
+  {
+    for (unsigned int i = 0; i < this->weaponManagerSecondary->getSlotCount(); i++)
+    {
+      Weapon* weapon = this->weaponManagerSecondary->getWeapon(i);
+      if (weapon != NULL)
+      {
+        weapon->getEnergyWidget()->hide();
+        //this->weaponsWidgetsSec.remove(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (weapon->getEnergyWidget()));
+      }
+    }
+  }
+
   this->weaponManager = weaponMan;
+  this->weaponManagerSecondary = weaponManSec; 
 
   this->updateWeaponManager();
@@ -139,15 +233,59 @@
 }
 
+/*
+void Hud::clearWeaponManager()
+{
+  //Hide all widgets
+  if (this->weaponManager != NULL)
+  {
+    for (unsigned int i = 0; i < this->weaponManager->getSlotCount(); i++)
+    {
+      Weapon* weapon = this->weaponManager->getWeapon(i);
+      if (weapon != NULL)
+      {
+        weapon->getEnergyWidget()->hide();
+        //this->weaponsWidgetsPrim.remove(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (weapon->getEnergyWidget()));
+      }
+    }
+  }
+
+  if (this->weaponManagerSecondary != NULL)
+  {
+    for (unsigned int i = 0; i < this->weaponManagerSecondary->getSlotCount(); i++)
+    {
+      Weapon* weapon = this->weaponManagerSecondary->getWeapon(i);
+      if (weapon != NULL)
+      {
+        weapon->getEnergyWidget()->hide();
+        //this->weaponsWidgetsSec.remove(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (weapon->getEnergyWidget()));
+      }
+    }
+  }
+
+  //this->weaponsWidgetsPrim.clear();
+  //this->weaponsWidgetsSec.clear();
+}
+*/
+
 void Hud::updateWeaponManager()
 {
   // hide all the Widgets
-  std::list<OrxGui::GLGuiWidget*>::iterator weaponWidget;
-  for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++)
+  
+  std::list<OrxGui::GLGuiEnergyWidgetVertical*>::iterator weaponWidget;
+  for (weaponWidget = this->weaponsWidgetsPrim.begin(); weaponWidget != this->weaponsWidgetsPrim.end(); weaponWidget++)
   {
     (*weaponWidget)->hide();
   }
-  this->weaponsWidgets.clear();
+  this->weaponsWidgetsPrim.clear();
+
+  for (weaponWidget = this->weaponsWidgetsSec.begin(); weaponWidget != this->weaponsWidgetsSec.end(); weaponWidget++)
+  {
+    (*weaponWidget)->hide();
+  }
+  this->weaponsWidgetsSec.clear();
+  
 
   // add all that we need again.
+
   if (this->weaponManager != NULL)
     for (unsigned int i = 0; i < this->weaponManager->getSlotCount(); i++)
@@ -157,12 +295,33 @@
       {
         //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClassCName(), weapon->getName());
+        weapon->getEnergyWidget()->setParent2D(this->rightRect);
         weapon->getEnergyWidget()->show();
         weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1));
         weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6));
-        //      weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);
-        this->weaponsWidgets.push_back(weapon->getEnergyWidget());
+        weapon->getEnergyWidget()->setWidgetSize(120,30);
+        //weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);
+        this->weaponsWidgetsPrim.push_back(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (weapon->getEnergyWidget()));
       }
     }
+
+  if (this->weaponManagerSecondary != NULL)
+    for (unsigned int i = 0; i < this->weaponManagerSecondary->getSlotCount(); i++)
+    {
+      Weapon* weapon = this->weaponManagerSecondary->getWeapon(i);
+      if (weapon != NULL)
+      {
+        //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClassCName(), weapon->getName());
+        weapon->getEnergyWidget()->setParent2D(this->rightRect);
+        weapon->getEnergyWidget()->show();
+        weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1));
+        weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6));
+        weapon->getEnergyWidget()->setWidgetSize(150,50);
+        //weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);
+        this->weaponsWidgetsSec.push_back(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (weapon->getEnergyWidget()));
+      }
+    }
+
   this->updateResolution();
+
 }
 
@@ -182,40 +341,180 @@
   this->notifier->setWidgetSize(0.25 * this->resX, 0.6 * this->resY);
 
+  int overlayWidth = 0;
+  if (overlayPercentage >= 20)
+    overlayWidth = this->resX * (overlayPercentage)/(200);
+  else
+    overlayWidth = this->resX * 0.1;
+  //if (overlayWidth < 100)
+    //overlayWidth = 100;
+
+  this->rightRect->hide();
+  this->leftRect->hide();
+
+  this->leftRect->setParent2D(this);
+  this->leftRect->setWidgetSize(float(overlayWidth), float(this->resY));
+  this->leftRect->setAbsCoor2D(0,0);
+  this->leftRect->setBackgroundTexture(Texture());
+  this->leftRect->setBackgroundColor(Color(0,0,0.7,0.2));
+  this->leftRect->setForegroundTexture(Texture());
+  this->leftRect->setForegroundColor(Color(0,0,0,0));
+
+  this->rightRect->setParent2D(this);
+  this->rightRect->setWidgetSize(float(overlayWidth), float(this->resY));
+  this->rightRect->setAbsCoor2D(this->resX - overlayWidth,0);
+  this->rightRect->setBackgroundTexture(Texture());
+  this->rightRect->setBackgroundColor(Color(0,0,0.7,0.2));
+  this->rightRect->setForegroundTexture(Texture());
+  this->rightRect->setForegroundColor(Color(0,0,0,0));
+
+
+  if (this->overlayActive == true)
+  {
+    this->rightRect->show();
+    this->leftRect->show();
+  }
+
 
   if (State::getPlayer() && State::getPlayer()->getPlayable() && State::getObjectManager())
   {
     PRINTF(4)("UPDATING RADAR\n");
-    this->_radar->setCenterNode(State::getPlayer()->getPlayable());
-    this->_radar->addEntityList(&State::getObjectManager()->getEntityList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0));
-    this->_radar->addEntityList(&State::getObjectManager()->getEntityList(OM_GROUP_02), Color(1.0, .2, .2));
-    this->_radar->setAbsCoor2D(0.8 * this->resX, 0.01 * this->resY);
-    this->_radar->setWidgetSize(0.2 * this->resX, 0.2 * this->resY);
+    this->_radar->setParent2D(this->leftRect);
+    if (radarCenterNode == NULL)
+      this->_radar->setCenterNode(State::getPlayer()->getPlayable());
+    else
+      this->_radar->setCenterNode(this->radarCenterNode);
+
+    //this->_radar->addEntityList(&State::getObjectManager()->getEntityList((OM_LIST)(State::getPlayer()->getPlayable()->getOMListNumber()+1)), Color(.4, .4, 1.0));
+    this->_radar->addEntityList(&State::getObjectManager()->getEntityList(OM_GROUP_00), Color(1, 0, 0));
+    this->_radar->addEntityList(&State::getObjectManager()->getEntityList(OM_GROUP_01), Color(0, 0, 1));
+    this->_radar->setAbsCoor2D(0, 0.01 * this->resY);
+    this->_radar->setWidgetSize(overlayWidth, overlayWidth);
     this->_radar->setRange(300);
     this->_radar->show();
-  }
-
-
-  if (this->energyWidget != NULL)
-  {
-    this->energyWidget->setAbsCoor2D(0.0 * this->resX, 0.85 * this->resY);
-    this->energyWidget->setWidgetSize(.25 * this->resX, 0.1 * this->resY);
-  }
-
-
-  std::list<OrxGui::GLGuiWidget*>::iterator weaponWidget;
-  Vector2D pos(0.3, .9);
-  for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++, pos.x+=.2)
-  {
-    if (pos.x > .8)
-    {
-      pos.x = 0.3;
-      pos.y -= .1;
-
-    }
-    (*weaponWidget)->setAbsCoor2D(pos.x*this->resX, pos.y*this->resY);
-    (*weaponWidget)->setWidgetSize(.02*this->resX, .1 *this->resY);
+    
+    int statWidgetsNumber = 0;
+    float expectedArmorSizeX = 0;
+    float expectedArmorSizeY = 0;
+    float newSizeY = 0; float newSizeX = 0;
+    float moduloWidth = 0;
+
+    if (this->armorWidget != NULL)
+    {
+      expectedArmorSizeX = 150;
+      expectedArmorSizeY = 50;
+      statWidgetsNumber++;
+    }
+
+    if (this->shieldWidget != NULL)
+      statWidgetsNumber++;
+    
+    if (this->energyWidget != NULL)
+      statWidgetsNumber++;
+
+    if (expectedArmorSizeY * statWidgetsNumber > overlayWidth)
+    {
+      newSizeY = overlayWidth / float(statWidgetsNumber);
+      newSizeX = expectedArmorSizeX;
+      PRINTF(0)("Statwidgets resized\n");
+    }
+    else
+    {
+      newSizeY = expectedArmorSizeY;
+      newSizeX = expectedArmorSizeX;
+      moduloWidth = int(overlayWidth) % int(expectedArmorSizeY * statWidgetsNumber);
+    }
+
+    float posY = overlayWidth + newSizeX;
+
+    if (this->armorWidget != NULL)
+    {
+      this->armorWidget->setSize2D(newSizeX, newSizeY);
+      this->armorWidget->setRelCoor2D((statWidgetsNumber - 1) * newSizeY + 3 * moduloWidth / (statWidgetsNumber + 1),posY);
+    }
+    if (this->shieldWidget != NULL)
+    {
+      this->shieldWidget->setSize2D(newSizeX, newSizeY);
+      this->shieldWidget->setRelCoor2D((statWidgetsNumber - 2) * newSizeY + 2 *moduloWidth / (statWidgetsNumber + 1),posY);
+    }
+    if (this->energyWidget != NULL)
+    {
+      this->energyWidget->setSize2D(newSizeX, newSizeY);
+      this->energyWidget->setRelCoor2D(moduloWidth / (statWidgetsNumber + 1),posY);
+    }
+
+    /*
+    if (this->armorWidget != NULL)
+      this->armorWidget->setRelCoor2D(100,0.2*this->resY + this->armorWidget->getSizeX2D());
+    if (this->shieldWidget != NULL)
+      this->shieldWidget->setRelCoor2D(60,0.2*this->resY + this->armorWidget->getSizeX2D());
+    if (this->energyWidget != NULL)
+      this->energyWidget->setRelCoor2D(20,0.2*this->resY + this->armorWidget->getSizeX2D());
+    */
+    //this->shieldWidget->setRelCoor2D(0.1*this->resX + this->armorWidget->getSizeX2D(),0);
+    //this->energyWidget->setRelCoor2D(0.1*this->resX + this->armorWidget->getSizeX2D() + this->shieldWidget->getSizeX2D(),0);
+  }
+
+  /*
+  if (this->shipValuesBox != NULL)
+  {
+    this->shipValuesBox->setAbsCoor2D(0.2 * this->resX, 0.4 * this->resY);
+    this->shipValuesBox->setWidgetSize(.4 * this->resX, 0.1 * this->resY);
+  }
+  else
+    createShipValuesBox();
+  */
+
+  std::list<OrxGui::GLGuiEnergyWidgetVertical*>::iterator weaponWidget;
+  Vector2D pos = Vector2D(overlayWidth, 0.4*this->resY);
+  float largestWidgetSizeX = 0;
+  //PRINTF(0)("Cur Pos: %f,%f\n",pos.x,pos.y);
+  // out of reasons i can't get behind, this version is segfaulting when calling getSizeX2D or getSizeY2D. the other
+  // element2D- related function works tough.. :s
+
+  for (weaponWidget = this->weaponsWidgetsPrim.begin(); weaponWidget != this->weaponsWidgetsPrim.end(); weaponWidget++)
+  {
+    float ySize = (*weaponWidget)->getSizeY2D();
+    float xSize = (*weaponWidget)->getSizeX2D();
+    if (xSize > largestWidgetSizeX)
+      largestWidgetSizeX = xSize;
+    if (pos.x < ySize)
+    {
+      pos.x = overlayWidth;
+      pos.y += largestWidgetSizeX;
+    }
+    pos.x -= ySize;
+    (*weaponWidget)->setAbsCoor2D(pos.x + this->rightRect->getAbsCoor2D().x, pos.y);
+    //(*weaponWidget)->setAbsCoor2D(0,100);
     (*weaponWidget)->show();
     //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName());
   }
+  
+  weaponWidget = this->weaponsWidgetsSec.begin();
+  float expectedWidgetSizeY = 0;
+  if (weaponWidget != this->weaponsWidgetsSec.end())
+  {
+    expectedWidgetSizeY = (*weaponWidget)->getSizeY2D();
+  }
+  pos.y = resY - expectedWidgetSizeY * 0.6;
+  pos.x = overlayWidth + this->rightRect->getAbsCoor2D().x;
+
+  for (weaponWidget = this->weaponsWidgetsSec.begin(); weaponWidget != this->weaponsWidgetsSec.end(); weaponWidget++)
+  {
+    float ySize = (*weaponWidget)->getSizeY2D();
+    float xSize = (*weaponWidget)->getSizeX2D();
+    if (xSize > largestWidgetSizeX)
+      largestWidgetSizeX = xSize;
+    if (pos.x < ySize)
+    {
+      pos.x = overlayWidth;
+      pos.y -= largestWidgetSizeX + expectedWidgetSizeY * 0.6;
+    }
+    pos.x -= ySize;
+    //PRINTF(0)("secweaponwidget y-size: %f/n", (*weaponWidget)->getSizeY2D());
+    (*weaponWidget)->setAbsCoor2D(pos.x + this->rightRect->getAbsCoor2D().x, pos.y);
+    (*weaponWidget)->show();
+    //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName());
+  }
+
 }
 
@@ -235,7 +534,17 @@
   //  this->inputLine->select();
   }
-
-
-}
-
-
+}
+
+/*
+void Hud::createShipValuesBox()
+{
+  this->shipValuesBox = new OrxGui::GLGuiBox(OrxGui::Vertical);
+  //this->shipValuesBox->setWidgetSize(1000,500);
+  //this->shipValuesBox->setBackgroundTexture("maps/gui_container_background.png");
+  this->shipValuesBox->setBackgroundTexture(Texture());
+  this->shipValuesBox->setBackgroundColor(Color(0,0,1,0.5));
+  this->shipValuesBox->setVisibility(true);
+}
+*/
+
+
Index: trunk/src/util/hud.h
===================================================================
--- trunk/src/util/hud.h	(revision 10351)
+++ trunk/src/util/hud.h	(revision 10368)
@@ -9,4 +9,6 @@
 #include "element_2d.h"
 #include "event_listener.h"
+#include "glgui_box.h"
+#include "elements/glgui_energywidgetvertical.h"
 
 
@@ -39,5 +41,10 @@
   void setShiledWidget(OrxGui::GLGuiWidget* widget);
   void setArmorWidget(OrxGui::GLGuiWidget* widget);
-  void setWeaponManager(WeaponManager* weaponMan);
+  inline OrxGui::GLGuiWidget* getEnergyWidget() {return this->energyWidget;};
+  inline OrxGui::GLGuiWidget* getShieldWidget() {return this->shieldWidget;};
+  inline OrxGui::GLGuiWidget* getArmorWidget() {return this->armorWidget;};
+
+  void setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec = NULL);
+  inline void setRadarCenterNode(PNode* node) {this->radarCenterNode = node;};
 
   void addWeaponWidget(OrxGui::GLGuiWidget* widget);
@@ -47,4 +54,20 @@
 
   void updateWeaponManager();
+  //void clearWeaponManager();
+
+  inline void setOverlayPercentage(int perc) 
+  {
+    if (perc > 100) perc = 100;
+    else if (perc < 0) perc = 0;
+
+    this->overlayPercentage = perc;
+    updateResolution();
+  };
+
+  inline void setOverlayActive(bool b)
+  {
+    overlayActive = b;
+    updateResolution();
+  };
 
   void draw() const;
@@ -54,8 +77,11 @@
   private:
     void updateResolution();
+    //void createShipValuesBox();
 
 private:
   unsigned int             resX;
   unsigned int             resY;
+
+  float                    travelZoneWidth; //the percentage of the screen, the player has got for his movements. should always be a value between 0 and 1;
 
   OrxGui::GLGuiWidget*     energyWidget;
@@ -66,8 +92,16 @@
   OrxGui::GLGuiInputLine*  inputLine;
   OrxGui::GLGuiRadar*      _radar;
+  PNode*                   radarCenterNode;
+
+  OrxGui::GLGuiWidget*     rightRect;
+  OrxGui::GLGuiWidget*     leftRect;
+  bool                     overlayActive;
+  int                      overlayPercentage; //the percentage of the screen, the player has got for his movements. should always be a value between 0 and 1;
 
   WeaponManager*           weaponManager;
+  WeaponManager*           weaponManagerSecondary;
 
-  std::list<OrxGui::GLGuiWidget*> weaponsWidgets; //!< WeaponWidgets will be displayed one after another
+  std::list<OrxGui::GLGuiEnergyWidgetVertical*> weaponsWidgetsPrim; //!< WeaponWidgets will be displayed one after another
+  std::list<OrxGui::GLGuiEnergyWidgetVertical*> weaponsWidgetsSec;
 };
 
Index: trunk/src/util/state.h
===================================================================
--- trunk/src/util/state.h	(revision 10351)
+++ trunk/src/util/state.h	(revision 10368)
@@ -109,4 +109,11 @@
   static inline int getMenuID() { return State::menuID;}
 
+  ////////////////////////
+  /// Scroller-Control ///
+  ////////////////////////
+  /** sets the scroller-travelnode (center of the screen) */
+  static void setTravelNode(PNode* travelNode) {State::travelNode = travelNode;}
+  /** @returns the scroller-travelnode (center of the screen) */
+  static PNode* getTravelNode() { return State::travelNode; }
 
 
@@ -123,4 +130,5 @@
   static GameRules*             gameRules;          //!< A reference to the GameRules
   static Player*                player;             //!< A reference to the Player
+  static PNode*                 travelNode;         //!< A reference to the scroller-travelnode
 
   static SkyBox*                skyBox;            //!< The SkyBox used in the current world.
Index: trunk/src/util/track/track.cc
===================================================================
--- trunk/src/util/track/track.cc	(revision 10368)
+++ trunk/src/util/track/track.cc	(revision 10368)
@@ -0,0 +1,260 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+
+   This is anohter installment of the infamous track system. It serves for
+   temporary use only and is mainly a slimmed version of the old track.
+
+   The track is used to steer the spaceship. In this case the track will have
+   to control a PNode. The spaceship will be able to fly around this node.
+   The camera will always be focused on that point.
+
+   As we do this we have exactly the verticalscroller feeling we want.
+
+   main-programmer: Benjamin Knecht
+*/
+
+#include "util/loading/load_param.h"
+#include "track/track.h"
+
+#include "p_node.h"
+
+#include "stdincl.h"
+
+#include "debug.h"
+
+ObjectListDefinition(Track);
+// CREATE_FACTORY(Track);
+
+
+/**
+ *  standard constructor
+*/
+Track::Track()
+{
+  this->init();
+}
+
+
+/**
+ * this is a constructor for use with the xml loading file
+ * @param root xml root element for this object
+ */
+Track::Track(const TiXmlElement* root)
+{
+  this->init();
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ * initializes this class
+ */
+void Track::init()
+{
+  this->curveType = CURVE_BEZIER;
+//  this->startingTime = 0;
+  this->duration = 20;
+  this->endTime = 20;
+  this->width = 10;
+  this->curve = new BezierCurve();
+  this->trackNode = new PNode(PNode::getNullParent(), PNODE_ALL);
+  this->nodeCount = 0;
+  this->localTime = 0;
+}
+
+/**
+ *  standard destructor
+*/
+Track::~Track()
+{
+
+}
+
+
+void Track::loadParams(const TiXmlElement* root)
+{
+     LOAD_PARAM_START_CYCLE(root, element);
+     {
+           LoadParam_CYCLE(element, "addPoint", this, Track, addPoint)
+             .describe("Adds a new Point to the currently selected TrackElement");
+           LoadParam_CYCLE(element, "speed", this, Track, setSpeed)
+             .describe("Sets speed of traveling");
+
+     }
+     LOAD_PARAM_END_CYCLE(element);
+}
+
+
+
+/**
+ * This function adds a point with its coordinates to the track
+ * @param x
+ * @param y
+ * @param z
+ */
+void Track::addPoint(float x, float y, float z)
+{
+     this->addPointV(Vector (x,y,z));
+}
+
+
+/**
+ * This function adds a point to the track as a vector
+ * @param newPoint
+ */
+void Track::addPointV(Vector newPoint)
+{
+   this->curve->addNode(newPoint);
+   if( this->nodeCount == 0) this->trackNode->setAbsCoor(newPoint);
+   this->nodeCount++;
+   // PRINTF(0)("Point added to curve\n");
+}
+
+/**
+ * This function sets the speed of the trackNode by altering the duration
+ * of the time the trackNode travels on the whole track. This is bad because
+ * the speed depends on the length of the curve. (by getting the curve's length
+ * this function will make a lot more sense)
+ */
+void Track::setSpeed(float speed)
+{
+     this->duration = this->duration/speed;
+     
+}
+
+/**
+ * We probably doesn't even need this
+ */
+//void Track::finalize()
+//{
+//   for (int i = 1; i<= trackElemCount ;i++)
+//     {
+//       TrackElement* tmpElem = this->firstTrackElem->findByID(i);
+//       if( tmpElem->childCount > 0)
+//         {
+//           tIterator<TrackElement>* iterator = tmpElem->children->getIterator();
+//           TrackElement* enumElem = iterator->firstElement();
+//           //TrackElement* enumElem = tmpElem->children->enumerate();
+//           while (enumElem)
+//             {
+//
+//               // c1-continuity
+//               enumElem->curve->addNode(enumElem->curve->getNode(0) +
+//                                                    ((enumElem->curve->getNode(0) -
+//                                                     tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1))
+//                                                     ),2);
+//               enumElem->nodeCount++;
+//               // c2-continuity
+//               enumElem->curve->addNode((tmpElem->curve->getNode(tmpElem->curve->getNodeCount())-
+//                                                     tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1)) * 4 +
+//                                                    tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-2), 3);
+//               enumElem->nodeCount++;
+//               PRINTF(5)("accelerations: %d-in: count: %d, %f, %f, %f\n                  %d-out: count: %d %f, %f, %f\n",
+//                      tmpElem->ID, tmpElem->nodeCount,
+//                      tmpElem->curve->calcAcc(0.999).x, tmpElem->curve->calcAcc(0.999).y, tmpElem->curve->calcAcc(0.999).z,
+//                      enumElem->ID, enumElem->nodeCount,
+//                      enumElem->curve->calcAcc(0).x, enumElem->curve->calcAcc(0).y, enumElem->curve->calcAcc(0).z);
+//
+//               enumElem = iterator->nextElement();
+//             }
+//           delete iterator;
+//         }
+//     }
+
+
+
+  /*for (int i = 1; i <= trackElemCount;i++)
+    if (this->firstTrackElem->findByID(i)->endTime > this->maxTime)
+      this->maxTime = this->firstTrackElem->findByID(i)->endTime; // very bad implemented :/
+      */
+//}
+
+Vector Track::calcPos() const
+{
+  return this->curve->calcPos(this->localTime/this->duration);
+}
+
+Vector Track::calcDir() const
+{
+  return this->curve->calcDir(this->localTime/this->duration);
+}
+
+void Track::tick(float dt)
+{
+//   PRINTF(4)("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt);
+//   if (this->localTime <= this->firstTrackElem->duration)
+//     this->jumpTo(this->localTime);
+//   if (this->localTime <= this->maxTime)
+     this->localTime += dt;
+     if(this->localTime >= this->duration)
+       this->localTime = 0;
+//   if (this->localTime > this->currentTrackElem->endTime
+//       && this->currentTrackElem->children)
+//     {
+//       if (this->currentTrackElem->jumpTime != 0.0)
+//         this->jumpTo(this->localTime + this->currentTrackElem->jumpTime);
+//       // jump to the next TrackElement and also set the history of the new Element to the old one.
+//       TrackElement* tmpHistoryElem = this->currentTrackElem;
+//       this->currentTrackElem = this->currentTrackElem->getChild(this->choosePath(this->currentTrackElem));
+//       this->currentTrackElem->history = tmpHistoryElem;
+//       if (this->currentTrackElem->getName())
+//         {
+//           this->trackText->setText(this->currentTrackElem->getName());
+//           this->textAnimation->replay();
+//         }
+//     }
+   if (this->trackNode)
+     {
+       Vector tmp = this->calcPos();
+       //Quaternion quat = Quaternion(this->calcDir(), Vector(this->curve->calcAcc(this->localTime/this->duration).x,1,this->curve->calcAcc(this->localTime/this->duration).z));
+       
+
+       Vector v(0.0, 1.0, 0.0);
+       Quaternion quat = Quaternion(this->calcDir(), v);
+       Quaternion q(-PI/2, v);
+       quat = quat * q;
+
+       // move trackNode of the track
+       this->trackNode->shiftCoor(tmp - this->trackNode->getAbsCoor());
+       // set direction and roll angle of trackNode
+       this->trackNode->setAbsDir(quat);
+     }
+}
+
+/**
+ * @returns the main TrackNode
+*/
+PNode* Track::getTrackNode()
+{
+  return this->trackNode;
+}
+
+/**
+ *  Imports a model of the Graph into the OpenGL-environment.
+ * @param dt The Iterator used in seconds for Painting the Graph.
+
+   This is for testing facility only. Do this if you want to see the Path inside the Level.
+   eventually this will all be packed into a gl-list.
+*/
+/*void Track::drawGraph(float dt) const
+{
+      glBegin(GL_LINE_STRIP);
+        for(float f = 0.0; f < 1.0; f+=dt)
+          {
+            // PRINTF(4)("drawing",this->calcPos().x, this->calcPos().y, this->calcPos().z);
+            Vector tmpVector = this->curve->calcPos(f);
+            glVertex3f(tmpVector.x, tmpVector.y, tmpVector.z);
+          }
+      glEnd();
+}*/
Index: trunk/src/util/track/track.h
===================================================================
--- trunk/src/util/track/track.h	(revision 10368)
+++ trunk/src/util/track/track.h	(revision 10368)
@@ -0,0 +1,56 @@
+/*!
+ * @file track.h
+ */
+
+#ifndef _TRACK_H_
+#define _TRACK_H_
+
+#include "curve.h"
+#include "base_object.h"
+
+// Forward Definition
+class PNode;
+class TiXmlElement;
+
+class Track : public BaseObject
+{
+  ObjectListDeclaration(Track);
+
+ public:
+   Track();
+   Track(const TiXmlElement* root);
+   virtual ~Track();
+
+   virtual void loadParams(const TiXmlElement* root);
+   void addPoint(float x, float y, float z);
+   void addPointV(Vector newPoint);
+   void setSpeed(float speed);
+
+   //void finalize();
+   inline Vector calcPos() const;
+   inline Vector calcDir() const;
+   void tick(float dt);
+
+   PNode* getTrackNode();
+   
+//   void drawGraph(float dt) const;
+      
+   //float                 startingTime;         //!< The time at which this Track begins.
+   float                 duration;             //!< The time used to cross this Track (curve).
+   float                 endTime;              //!< The time at which this Track ends.
+   float                 width;                //!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right.
+
+   int                   nodeCount;            //!< The count of points this Track has.
+   Curve*                curve;                //!< The Curve of this Track
+
+ private:
+   void init();
+
+
+ private:
+   CurveType            curveType;              //!< The CurveType the entire TrackSystem will have.
+   float                localTime;              //!< The time that has been passed since the traveling the Track.
+   PNode*               trackNode;              //!< The node that is slave to the Track. This node will be moved while update the Track, and must NOT move itself.
+};
+
+#endif /* _TRACK_H */
Index: trunk/src/util/track/track_manager.cc
===================================================================
--- trunk/src/util/track/track_manager.cc	(revision 10351)
+++ trunk/src/util/track/track_manager.cc	(revision 10368)
@@ -26,4 +26,6 @@
 #include "t_animation.h"
 
+#include <string.h>
+
 
 #include "parser/tinyxml/tinyxml.h"
@@ -32,4 +34,5 @@
 #include <stdarg.h>
 
+ObjectListDefinition(TrackElement);
 
 
@@ -39,5 +42,6 @@
 TrackElement::TrackElement()
 {
-  this->setClassID(CL_TRACK_ELEMENT, "TrackElement");
+  this->registerObject(this, TrackElement::_objectList);
+
 
   this->isFresh = true;
@@ -126,6 +130,6 @@
 {
   // return if Found.
-  if (this->getName() && !strcmp(this->getName(), trackName))
-    return this;
+//   if (this->getName() && !strcmp(this->getName(), trackName))
+//     return this;
   // search all children
   if (this->childCount > 0)
@@ -217,43 +221,43 @@
 void TrackElement::debug() const
 {
-  PRINT(0)("--== TrackElement:%i ==--", this->ID);
-  if(this->getName())
-    PRINT(0)("--++Name: %s++--", this->getName());
-  if(this->isFresh)
-    PRINT(0)("  -- has not jet eddited in any way --\n");
-  PRINT(0)("\n   TimeTable: startingTime=%f; endTime=%f; duration=%f; jumpTime=%f\n", this->startingTime, this->endTime, this->duration, this->jumpTime);
-  PRINT(0)("   consists of %d Points\n", this->nodeCount);
-  if (this->childCount == 0)
-    PRINT(0)("   has no child\n");
-  else if (this->childCount == 1)
-    PRINT(0)("   has 1 child: =%d=\n", this->getChild(0)->ID);
-  else if (this->childCount > 1)
-    {
-      PRINT(0)("   has %d children: ", this->childCount);
-      //TrackElement* enumElem = this->children->enumerate();
-      tIterator<TrackElement>* iterator = this->children->getIterator();
-      TrackElement* enumElem = iterator->firstElement();
-      while (enumElem)
-        {
-          PRINT(0)("=%d= ", enumElem->ID);
-          enumElem = iterator->nextElement();
-        }
-      delete iterator;
-      PRINT(0)("\n");
-    }
-
-  if(this->isHotPoint)
-    PRINT(0)("   is a special Point:\n");
-  if(this->isSavePoint)
-    PRINT(0)("    is a SavePoint\n");
-  if(this->isFork)
-    {
-      PRINT(0)("    is A Fork with with %d children.\n", this->childCount);
-    }
-  if(this->isJoined)
-    PRINT(0)("   is Joined at the End\n");
-
-  if(!this->backLoopCheck()) /* this should not happen */
-    PRINT(2)(" THERE IS A BACKLOOP TO THIS ELEMENT\n");
+//   PRINT(0)("--== TrackElement:%i ==--", this->ID);
+//   if(this->getName())
+//     PRINT(0)("--++Name: %s++--", this->getName());
+//   if(this->isFresh)
+//     PRINT(0)("  -- has not jet eddited in any way --\n");
+//   PRINT(0)("\n   TimeTable: startingTime=%f; endTime=%f; duration=%f; jumpTime=%f\n", this->startingTime, this->endTime, this->duration, this->jumpTime);
+//   PRINT(0)("   consists of %d Points\n", this->nodeCount);
+//   if (this->childCount == 0)
+//     PRINT(0)("   has no child\n");
+//   else if (this->childCount == 1)
+//     PRINT(0)("   has 1 child: =%d=\n", this->getChild(0)->ID);
+//   else if (this->childCount > 1)
+//     {
+//       PRINT(0)("   has %d children: ", this->childCount);
+//       //TrackElement* enumElem = this->children->enumerate();
+//       tIterator<TrackElement>* iterator = this->children->getIterator();
+//       TrackElement* enumElem = iterator->firstElement();
+//       while (enumElem)
+//         {
+//           PRINT(0)("=%d= ", enumElem->ID);
+//           enumElem = iterator->nextElement();
+//         }
+//       delete iterator;
+//       PRINT(0)("\n");
+//     }
+//
+//   if(this->isHotPoint)
+//     PRINT(0)("   is a special Point:\n");
+//   if(this->isSavePoint)
+//     PRINT(0)("    is a SavePoint\n");
+//   if(this->isFork)
+//     {
+//       PRINT(0)("    is A Fork with with %d children.\n", this->childCount);
+//     }
+//   if(this->isJoined)
+//     PRINT(0)("   is Joined at the End\n");
+//
+//   if(!this->backLoopCheck()) /* this should not happen */
+//     PRINT(2)(" THERE IS A BACKLOOP TO THIS ELEMENT\n");
 }
 
@@ -358,7 +362,4 @@
 TrackManager::TrackManager()
 {
-  this->setClassID(CL_TRACK_MANAGER, "TrackManager");
-  this->setName("TrackManager");
-
   TrackManager::singletonRef = this; // do this because otherwise the TrackNode cannot get The instance of the TrackManager
 
@@ -395,29 +396,29 @@
 void TrackManager::loadParams(const TiXmlElement* root)
 {
-  double x, y, z, d;
-
-  LOAD_PARAM_START_CYCLE(root, element);
-  {
-
-    LoadParam_CYCLE(element, "WorkOn", this, TrackManager, workOnS)
-        .describe("Selects a TrackElement (by name) to work on");
-
-    LoadParam_CYCLE(element, "Point", this, TrackManager, addPoint)
-        .describe("Adds a new Point to the currently selected TrackElement");
-
-    LoadParam_CYCLE(element, "Duration", this, TrackManager, setDuration)
-        .describe("Sets the Duration of the currently selected TrackElement");
-
-    LoadParam_CYCLE(element, "HotPoint", this, TrackManager, addHotPoint)
-        .describe("Sets a new Point that acts as a hot point. meaning, the curve will flow through this Point");
-
-    LoadParam_CYCLE(element, "SavePoint", this, TrackManager, setSavePointS)
-        .describe("Sets the current selected Point to a Savepoint, meaning that the curve will be ended and a new one starts, and that one starts again from this point on");
-
-    LoadParam_CYCLE(element, "Fork", this, TrackManager, forkS)
-        .describe("Forks the Path into multiple forked Path names seperated by ','");
-
-    LoadParam_CYCLE(element, "Join", this, TrackManager, joinS)
-        .describe("Joins multiple joining Path names seperated by ','");
+//   double x, y, z, d;
+//
+//   LOAD_PARAM_START_CYCLE(root, element);
+//   {
+//
+//     LoadParam_CYCLE(element, "WorkOn", this, TrackManager, workOnS)
+//         .describe("Selects a TrackElement (by name) to work on");
+//
+//     LoadParam_CYCLE(element, "Point", this, TrackManager, addPoint)
+//         .describe("Adds a new Point to the currently selected TrackElement");
+//
+//     LoadParam_CYCLE(element, "Duration", this, TrackManager, setDuration)
+//         .describe("Sets the Duration of the currently selected TrackElement");
+//
+//     LoadParam_CYCLE(element, "HotPoint", this, TrackManager, addHotPoint)
+//         .describe("Sets a new Point that acts as a hot point. meaning, the curve will flow through this Point");
+//
+//     LoadParam_CYCLE(element, "SavePoint", this, TrackManager, setSavePointS)
+//         .describe("Sets the current selected Point to a Savepoint, meaning that the curve will be ended and a new one starts, and that one starts again from this point on");
+//
+//     LoadParam_CYCLE(element, "Fork", this, TrackManager, forkS)
+//         .describe("Forks the Path into multiple forked Path names seperated by ','");
+//
+//     LoadParam_CYCLE(element, "Join", this, TrackManager, joinS)
+//         .describe("Joins multiple joining Path names seperated by ','");
 
       /*
@@ -445,6 +446,7 @@
         }
       */
-  }
-  LOAD_PARAM_END_CYCLE(element);
+
+//   }
+//   LOAD_PARAM_END_CYCLE(element);
 }
 
@@ -477,38 +479,38 @@
 void TrackManager::initChildren(unsigned int childCount, TrackElement* trackElem)
 {
-  if (!trackElem)
-    trackElem = this->currentTrackElem;
-
-  trackElem->childCount = childCount;
-  trackElem->mainJoin = true;  // this tells join, that this one is the Main Join, if it tries to join multiple Tracks
-  trackElem->children =  new tList<TrackElement>();
-  for (int i = 0; i < childCount; i++)
-    {
-      // create a new Element
-      TrackElement* newElem = new TrackElement();
-      // setting up the new ID
-      newElem->ID = ++trackElemCount;
-      // setting up the Time
-      newElem->startingTime = trackElem->endTime + trackElem->jumpTime;
-      // adds the conection Point
-      this->addPointV(trackElem->curve->getNode(trackElem->curve->getNodeCount()),
-                     newElem);
-      // add the new child to the childList.
-      trackElem->children->add(newElem);
-    }
-
-  // setting the Name of the new TrackElement to the name of the last one + _childI
-
-  if (trackElem->getName())
-    {
-      for (int i = 0; i < trackElem->childCount; i++)
-      {
-        char* childName = new char[strlen(trackElem->getName())+10];
-        sprintf(childName, "%s_child%d", trackElem->getName(), i);
-        trackElem->getChild(i)->setName(childName);
-      }
-    }
-  // select the first Child to work on.
-  this->currentTrackElem = trackElem->getChild(0);
+//   if (!trackElem)
+//     trackElem = this->currentTrackElem;
+//
+//   trackElem->childCount = childCount;
+//   trackElem->mainJoin = true;  // this tells join, that this one is the Main Join, if it tries to join multiple Tracks
+//   trackElem->children =  new tList<TrackElement>();
+//   for (int i = 0; i < childCount; i++)
+//     {
+//       // create a new Element
+//       TrackElement* newElem = new TrackElement();
+//       // setting up the new ID
+//       newElem->ID = ++trackElemCount;
+//       // setting up the Time
+//       newElem->startingTime = trackElem->endTime + trackElem->jumpTime;
+//       // adds the conection Point
+//       this->addPointV(trackElem->curve->getNode(trackElem->curve->getNodeCount()),
+//                      newElem);
+//       // add the new child to the childList.
+//       trackElem->children->add(newElem);
+//     }
+//
+//   // setting the Name of the new TrackElement to the name of the last one + _childI
+//
+//   if (trackElem->getName())
+//     {
+//       for (int i = 0; i < trackElem->childCount; i++)
+//       {
+//         char* childName = new char[strlen(trackElem->getName())+10];
+//         sprintf(childName, "%s_child%d", trackElem->getName(), i);
+//         trackElem->getChild(i)->setName(childName);
+//       }
+//     }
+//   // select the first Child to work on.
+//   this->currentTrackElem = trackElem->getChild(0);
 }
 
@@ -659,7 +661,7 @@
 void TrackManager::setSavePointS(const std::string& nextElementName)
 {
-  this->setSavePoint(NULL);
-  if (strcmp(nextElementName, ""))
-    this->firstTrackElem->findByID(this->trackElemCount)->setName(nextElementName);
+//   this->setSavePoint(NULL);
+//   if (strcmp(nextElementName, ""))
+//     this->firstTrackElem->findByID(this->trackElemCount)->setName(nextElementName);
 }
 
@@ -736,14 +738,14 @@
 void TrackManager::forkS(const std::string& forkString)
 {
-  SubString strings(forkString, ',');
-
-  int* trackIDs = new int[strings.getCount()];
-  this->forkV(strings.getCount(), trackIDs, NULL);
-
-  for(int i = 0; i < strings.getCount(); i++)
-    {
-      this->firstTrackElem->findByID(trackIDs[i])->setName(strings.getString(i));
-    }
-  delete []trackIDs;
+//   SubString strings(forkString, ',');
+//
+//   int* trackIDs = new int[strings.getCount()];
+//   this->forkV(strings.getCount(), trackIDs, NULL);
+//
+//   for(int i = 0; i < strings.getCount(); i++)
+//     {
+//       this->firstTrackElem->findByID(trackIDs[i])->setName(strings.getString(i));
+//     }
+//   delete []trackIDs;
 }
 
@@ -877,22 +879,22 @@
 void TrackManager::joinS(const std::string& joinString)
 {
-  SubString strings(joinString, ',');
-
-  int* trackIDs = new int[strings.getCount()];
-  this->joinV(strings.getCount(), trackIDs);
-
-  for(unsigned int i = 0; i < strings.getCount(); i++)
-    {
-      TrackElement* tmpElem = this->firstTrackElem->findByName(strings.getString(i).c_str());
-      if (tmpElem != NULL)
-        trackIDs[i] = tmpElem->ID;
-      else
-      {
-        PRINTF(1)("Trying to join a Track, of which the name does not exist: %s\n", strings.getString(i).c_str());
-        trackIDs[i] = -1;
-      }
-    }
-  this->joinV(strings.getCount(), trackIDs);
-  delete []trackIDs;
+//   SubString strings(joinString, ',');
+//
+//   int* trackIDs = new int[strings.getCount()];
+//   this->joinV(strings.getCount(), trackIDs);
+//
+//   for(unsigned int i = 0; i < strings.getCount(); i++)
+//     {
+//       TrackElement* tmpElem = this->firstTrackElem->findByName(strings.getString(i).c_str());
+//       if (tmpElem != NULL)
+//         trackIDs[i] = tmpElem->ID;
+//       else
+//       {
+//         PRINTF(1)("Trying to join a Track, of which the name does not exist: %s\n", strings.getString(i).c_str());
+//         trackIDs[i] = -1;
+//       }
+//     }
+//   this->joinV(strings.getCount(), trackIDs);
+//   delete []trackIDs;
 }
 
@@ -1073,36 +1075,36 @@
 void TrackManager::tick(float dt)
 {
-  PRINTF(4)("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt);
-  if (this->localTime <= this->firstTrackElem->duration)
-    this->jumpTo(this->localTime);
-  if (this->localTime <= this->maxTime)
-    this->localTime += dt;
-  if (this->localTime > this->currentTrackElem->endTime
-      && this->currentTrackElem->children)
-    {
-      if (this->currentTrackElem->jumpTime != 0.0)
-        this->jumpTo(this->localTime + this->currentTrackElem->jumpTime);
-      // jump to the next TrackElement and also set the history of the new Element to the old one.
-      TrackElement* tmpHistoryElem = this->currentTrackElem;
-      this->currentTrackElem = this->currentTrackElem->getChild(this->choosePath(this->currentTrackElem));
-      this->currentTrackElem->history = tmpHistoryElem;
-      if (this->currentTrackElem->getName())
-        {
-          this->trackText->setText(this->currentTrackElem->getName());
-          this->textAnimation->replay();
-        }
-    }
-  if (this->bindSlave)
-    {
-      Vector tmp = this->calcPos();
-      Quaternion quat = Quaternion(this->calcDir(), Vector(this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).x,1,this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).z));
-
-      Vector v(0.0, 1.0, 0.0);
-      Quaternion q(-PI/2, v);
-      quat = quat * q;
-
-      this->bindSlave->setAbsCoor(tmp);
-      this->bindSlave->setAbsDir(quat);
-    }
+//   PRINTF(4)("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt);
+//   if (this->localTime <= this->firstTrackElem->duration)
+//     this->jumpTo(this->localTime);
+//   if (this->localTime <= this->maxTime)
+//     this->localTime += dt;
+//   if (this->localTime > this->currentTrackElem->endTime
+//       && this->currentTrackElem->children)
+//     {
+//       if (this->currentTrackElem->jumpTime != 0.0)
+//         this->jumpTo(this->localTime + this->currentTrackElem->jumpTime);
+//       // jump to the next TrackElement and also set the history of the new Element to the old one.
+//       TrackElement* tmpHistoryElem = this->currentTrackElem;
+//       this->currentTrackElem = this->currentTrackElem->getChild(this->choosePath(this->currentTrackElem));
+//       this->currentTrackElem->history = tmpHistoryElem;
+//       if (this->currentTrackElem->getName())
+//         {
+//           this->trackText->setText(this->currentTrackElem->getName());
+//           this->textAnimation->replay();
+//         }
+//     }
+//   if (this->bindSlave)
+//     {
+//       Vector tmp = this->calcPos();
+//       Quaternion quat = Quaternion(this->calcDir(), Vector(this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).x,1,this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).z));
+//
+//       Vector v(0.0, 1.0, 0.0);
+//       Quaternion q(-PI/2, v);
+//       quat = quat * q;
+//
+//       this->bindSlave->setAbsCoor(tmp);
+//       this->bindSlave->setAbsDir(quat);
+//     }
 }
 
@@ -1116,14 +1118,14 @@
 void TrackManager::jumpTo(float time)
 {
-  if (time == 0)
-    {
-      this->currentTrackElem = this->firstTrackElem;
-      if (this->currentTrackElem->getName())
-        {
-          this->trackText->setText(this->currentTrackElem->getName());
-          this->textAnimation->play();
-        }
-    }
-  this->localTime = time;
+//   if (time == 0)
+//     {
+//       this->currentTrackElem = this->firstTrackElem;
+//       if (this->currentTrackElem->getName())
+//         {
+//           this->trackText->setText(this->currentTrackElem->getName());
+//           this->textAnimation->play();
+//         }
+//     }
+//   this->localTime = time;
 }
 
Index: trunk/src/util/track/track_manager.h
===================================================================
--- trunk/src/util/track/track_manager.h	(revision 10351)
+++ trunk/src/util/track/track_manager.h	(revision 10368)
@@ -41,4 +41,6 @@
 class TrackElement : public BaseObject
 {
+  ObjectListDeclaration(TrackElement);
+
  public:
   TrackElement();
@@ -131,5 +133,5 @@
     \li TrackElement: A Part of A whole Track
 */
-class TrackManager : public BaseObject
+class TrackManager
 {
  public:
Index: trunk/src/util/track/track_node.cc
===================================================================
--- trunk/src/util/track/track_node.cc	(revision 10351)
+++ trunk/src/util/track/track_node.cc	(revision 10368)
@@ -17,10 +17,11 @@
 
 
-#include "track_node.h"
+#include "track/track_node.h"
 
-#include "track_manager.h"
+#include "track/track_manager.h"
 
 
-ObjectListDefinition(TracNode);
+ObjectListDefinition(TrackNode);
+
 /**
  *  standard constructor
@@ -28,6 +29,5 @@
 TrackNode::TrackNode ()
 {
-  this->registerObject(this, TracNode::_objectList);
-  this->setName("TrackNode");
+  this->registerObject(this, TrackNode::_objectList);
 
   PNode::getNullParent()->addChild(this);
Index: trunk/src/util/track/track_node.h
===================================================================
--- trunk/src/util/track/track_node.h	(revision 10351)
+++ trunk/src/util/track/track_node.h	(revision 10368)
@@ -14,4 +14,5 @@
 #include "p_node.h"
 
+
 /* FORWARD DECLARATION */
 class TrackManager;
@@ -20,5 +21,5 @@
 class TrackNode : public PNode
 {
-  ObjectListDeclaratrion(TracNode);
+  ObjectListDeclaration(TrackNode);
  public:
   TrackNode ();
Index: trunk/src/world_entities/Makefile.am
===================================================================
--- trunk/src/world_entities/Makefile.am	(revision 10351)
+++ trunk/src/world_entities/Makefile.am	(revision 10368)
@@ -6,66 +6,18 @@
 
 ## THESE ARE THE BASE CLASSES OF ALL WORLD_ENTITIES
-libORXwe_a_SOURCES = \
-		world_entity.cc \
-		\
-		camera.cc \
-		playable.cc \
-		player.cc \
-		\
-		npcs/npc.cc \
-		\
-		weapons/weapon_manager.cc \
-		weapons/crosshair.cc \
-		weapons/weapon.cc \
-		weapons/ammo_container.cc \
-		projectiles/projectile.cc \
-		\
-		extendable.cc \
-		power_ups/power_up.cc \
-		power_ups/param_power_up.cc \
-		power_ups/weapon_power_up.cc \
-		\
-		spawning_point.cc \
-		\
-		\
-		effects/explosion.cc \
-		effects/billboard.cc \
-		\
-		\
-		elements/glgui_energywidget.cc
+libORXwe_a_SOURCES = world_entity.cc 				camera.cc 		playable.cc 		player.cc \
+						npcs/npc.cc 				weapons/weapon_manager.cc 		weapons/crosshair.cc \
+				weapons/weapon.cc 		weapons/ammo_container.cc 		projectiles/projectile.cc \
+						extendable.cc 		power_ups/power_up.cc 		power_ups/param_power_up.cc \
+				power_ups/weapon_power_up.cc 				spawning_point.cc 						effects/explosion.cc 		effects/billboard.cc 		effects/wobblegrid.cc\
+				effects/trail.cc				elements/glgui_energywidget.cc elements/glgui_energywidgetvertical.cc
 
 
-noinst_HEADERS  = \
-		world_entity.h \
-		\
-		camera.h \
-		extendable.h \
-		playable.h \
-		player.h \
-		\
-		npcs/npc.h \
-		\
-		weapons/weapon_manager.h \
-		weapons/crosshair.h \
-		weapons/weapon.h \
-		weapons/ammo_container.h \
-		projectiles/projectile.h \
-		\
-		power_ups/power_up.h \
-		power_ups/param_power_up.h \
-		power_ups/weapon_power_up.h \
-		\
-		spawning_point.h \
-		\
-		\
-		effects/explosion.h \
-		effects/billboard.h \
-		\
-		\
-		\
-		elements/glgui_energywidget.h \
-		\
-		\
-		$(WorldEntities_HEADERS_)
+noinst_HEADERS = world_entity.h 				camera.h 		extendable.h 		playable.h \
+				player.h 				npcs/npc.h 				weapons/weapon_manager.h 		weapons/crosshair.h \
+				weapons/weapon.h 		weapons/ammo_container.h 		projectiles/projectile.h \
+						power_ups/power_up.h 		power_ups/param_power_up.h 		power_ups/weapon_power_up.h \
+						spawning_point.h 						effects/explosion.h 		effects/billboard.h		effects/trail.h  		effects/wobblegrid.h\
+										elements/glgui_energywidget.h elements/glgui_energywidgetvertical.h
 
 
Index: trunk/src/world_entities/WorldEntities.am
===================================================================
--- trunk/src/world_entities/WorldEntities.am	(revision 10351)
+++ trunk/src/world_entities/WorldEntities.am	(revision 10368)
@@ -23,4 +23,5 @@
                 world_entities/character_attributes.cc \
                 world_entities/test_entity.cc \
+                world_entities/test_entity2.cc \
                 world_entities/planet.cc \
                 world_entities/bsp_entity.cc \
@@ -39,5 +40,16 @@
                 world_entities/weapons/fps_sniper_rifle.cc \
                 world_entities/weapons/boomerang_gun.cc \
-                \
+                world_entities/weapons/light_blaster.cc \
+                world_entities/weapons/medium_blaster.cc \
+                world_entities/weapons/heavy_blaster.cc \
+                world_entities/weapons/swarm_launcher.cc \
+                world_entities/weapons/spike_launcher.cc \
+                world_entities/weapons/spike_thrower.cc \
+                world_entities/weapons/acid_launcher.cc \
+                \
+                world_entities/projectiles/lbolt.cc \
+                world_entities/projectiles/mbolt.cc \
+                world_entities/projectiles/hbolt.cc \
+                world_entities/projectiles/swarm_projectile.cc \
                 world_entities/projectiles/bomb.cc \
                 world_entities/projectiles/laser.cc \
@@ -48,4 +60,9 @@
                 world_entities/projectiles/boomerang_projectile.cc \
                 world_entities/projectiles/hyperblast.cc \
+                world_entities/projectiles/spike.cc \
+                world_entities/projectiles/acid_splash.cc \
+                \
+                world_entities/projectiles/projectile_weapon.cc \
+                world_entities/projectiles/spike_ball.cc \
                 \
                 world_entities/power_ups/turret_power_up.cc \
@@ -83,4 +100,5 @@
 		world_entities/particles/box_emitter.cc \
 		world_entities/particles/plane_emitter.cc \
+        world_entities/particles/emitter_node.cc \
 		\
 		world_entities/particles/particle_system.cc \
@@ -129,4 +147,5 @@
                 character_attributes.h \
                 test_entity.h \
+                test_entity2.h \
                 planet.h \
                 bsp_entity.h \
@@ -145,5 +164,16 @@
                 weapons/aiming_system.h \
                 weapons/fps_sniper_rifle.h \
-                \
+                weapons/light_blaster.h \
+                weapons/medium_blaster.h \
+                weapons/heavy_blaster.h \
+                weapons/swarm_launcher.h \
+                weapons/spike_launcher.h \
+                weapons/spike_thrower.h \
+                weapons/acid_launcher.h \
+                \
+                projectiles/lbolt.h \
+                projectiles/mbolt.h \
+                projectiles/hbolt.h \
+                projectiles/swarm_projectile.h \
                 projectiles/bomb.h \
                 projectiles/laser.h \
@@ -154,4 +184,10 @@
                 projectiles/boomerang_projectile.h \
                 projectiles/hyperblast.h \
+                projectiles/spike.h \
+                projectiles/spike_ball.h \
+                projectiles/acid_splash.h \
+                \
+                projectiles/projectile_weapon.h \
+                projectiles/spike_ball.h \
                 \
                 power_ups/turret_power_up.h \
@@ -172,6 +208,6 @@
                 environments/model_entity.h \
                 environments/building.h \
-		environments/rotor.h \
                 environments/mapped_water.h \
+                environments/rotor.h \
                 \
                 elements/image_entity.h \
@@ -188,4 +224,5 @@
 		particles/box_emitter.h \
 		particles/plane_emitter.h \
+        particles/emitter_node.h \
 		\
 		particles/particle_system.h \
Index: trunk/src/world_entities/camera.cc
===================================================================
--- trunk/src/world_entities/camera.cc	(revision 10351)
+++ trunk/src/world_entities/camera.cc	(revision 10368)
@@ -18,4 +18,6 @@
 #include "key_mapper.h"
 #include "glincl.h"
+//#include "util/loading/load_param.h"
+#include "world_entity.h"
 
 ObjectListDefinition(Camera);
@@ -27,4 +29,24 @@
 {
   this->registerObject(this, Camera::_objectList);
+  this->init();
+}
+
+/*
+Camera::Camera(const TiXmlElement* root)
+{
+  this->registerObject(this, Camera::_objectList);
+  this->init();
+  this->loadParams(root);
+}
+*/
+
+/**
+ *  default destructor
+*/
+Camera::~Camera()
+{}
+
+void Camera::init()
+{
   this->setName("camera");
   this->target = new CameraTarget();
@@ -37,18 +59,27 @@
   this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW5);
 
-  this->setFovy(90);
-  this->setAspectRatio(1.2f);
+  //this->setFovy(90);
+  this->setAspectRatio(1.33f);
   this->setClipRegion(.1, 10000);
+  
+  this->viewTopFovy = 60;
+  this->viewNormalFovy = 90;
+  this->viewFrontFovy = 120;
+  this->viewRightFovy = 90;
+  this->viewLeftFovy = 90;
+
+  this->viewTopDistance = 70;
+  this->viewNormalDistance = 10;
+  this->viewFrontDistance = 4;
+  this->viewRightDistance = 10;
+  this->viewLeftDistance = 10;
+
+  //this->loadParams(doc.RootElement());
 
   this->setViewMode(Camera::ViewNormal);
 
   this->setParentMode(PNODE_ALL);
-}
-
-/**
- *  default destructor
-*/
-Camera::~Camera()
-{}
+  this->eventHandling = true;
+}
 
 /**
@@ -100,29 +131,46 @@
     default:
     case Camera::ViewNormal:
-      this->toFovy = 60.0;
-      this->setRelCoorSoft(-10, 5, 0);
+    {
+      this->fovy = viewNormalFovy;
+      this->toFovy = viewNormalFovy;
+      //this->fovy = 60;
+      //this->toFovy = 60;
+      this->setRelCoorSoft(-2.0/3.0 * this->viewNormalDistance, 1.0/3.0 * this->viewNormalDistance, 0);
       this->target->setRelCoorSoft(0,0,0);
       break;
+    }
     case Camera::ViewBehind:
       break;
     case Camera::ViewFront:
-      this->toFovy = 120.0;
-      this->setRelCoorSoft(4, 0, 0, 5);
+    {
+      this->fovy = viewFrontFovy;
+      this->toFovy = viewFrontFovy;
+      this->setRelCoorSoft(this->viewFrontDistance, 0, 0, 5);
       this->target->setRelCoorSoft(Vector(10,0,0), 5);
       break;
+    }
     case Camera::ViewLeft:
-      this->toFovy = 90;
-      this->setRelCoorSoft(0, 1, -10, .5);
+    {
+      this->fovy = viewLeftFovy;
+      this->toFovy = viewLeftFovy;
+      this->setRelCoorSoft(0, 1, -viewLeftDistance, .5);
       this->target->setRelCoorSoft(0,0,0);
       break;
+    }
     case Camera::ViewRight:
-      this->toFovy = 90;
-      this->setRelCoorSoft(Vector(0, 1, 10));
+    {
+      this->fovy = viewRightFovy;
+      this->toFovy = viewRightFovy;
+      this->setRelCoorSoft(Vector(0, 1, viewRightDistance), 0.5);
       this->target->setRelCoorSoft(0,0,0);
       break;
+    }
     case Camera::ViewTop:
-      this->toFovy= 120;
-      this->setRelCoorSoft(Vector(30, 50, 0));
-      this->target->setRelCoorSoft(35,0,0);
+    {
+      this->fovy= viewTopFovy;
+      this->toFovy = viewTopFovy;
+      this->setRelCoor(Vector(-0.05, this->viewTopDistance , 0));
+      this->target->setRelCoor(0,0,0);
+    }
   }
 }
@@ -143,5 +191,5 @@
 
   float tmpFovy = (this->toFovy - this->fovy);
-  if (tmpFovy > 0.01)
+  if (fabsf(tmpFovy) > 0.01)
     this->fovy += tmpFovy * fabsf(dt);
 }
@@ -192,28 +240,113 @@
 void Camera::process(const Event &event)
 {
-  if( event.type == KeyMapper::PEV_VIEW0)
+  if (eventHandling == true)
   {
-    this->setViewMode(Camera::ViewNormal);
+    if( event.type == KeyMapper::PEV_VIEW0)
+    {
+      this->setViewMode(Camera::ViewNormal);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW1)
+    {
+      this->setViewMode(Camera::ViewBehind);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW2)
+    {
+      this->setViewMode(Camera::ViewFront);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW3)
+    {
+      this->setViewMode(Camera::ViewLeft);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW4)
+    {
+      this->setViewMode(Camera::ViewRight);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW5)
+    {
+      this->setViewMode(Camera::ViewTop);
+    }
   }
-  else if( event.type == KeyMapper::PEV_VIEW1)
-  {
-    this->setViewMode(Camera::ViewBehind);
-  }
-  else if( event.type == KeyMapper::PEV_VIEW2)
-  {
-    this->setViewMode(Camera::ViewFront);
-  }
-  else if( event.type == KeyMapper::PEV_VIEW3)
-  {
-    this->setViewMode(Camera::ViewLeft);
-  }
-  else if( event.type == KeyMapper::PEV_VIEW4)
-  {
-    this->setViewMode(Camera::ViewRight);
-  }
-  else if( event.type == KeyMapper::PEV_VIEW5)
-  {
-    this->setViewMode(Camera::ViewTop);
-  }
+}
+
+/*
+void Camera::loadParams(const TiXmlElement* root)
+{
+  // Do the PNode loading stuff
+  PNode::loadParams(root);
+
+  LoadParam(root, "viewTopFovy", this, Camera, setViewTopFovy);
+  LoadParam(root, "viewFrontFovy", this, Camera, setViewFrontFovy);
+  LoadParam(root, "viewLeftFovy", this, Camera, setViewLeftFovy);
+  LoadParam(root, "viewRightFovy", this, Camera, setViewRightFovy);
+  LoadParam(root, "viewBehindFovy", this, Camera, setViewBehindFovy);
+  LoadParam(root, "viewNormalFovy", this, Camera, setViewNormalFovy);
+
+  LoadParam(root, "viewTopDistance", this, Camera, setViewTopDistance);
+  LoadParam(root, "viewFrontDistance", this, Camera, setViewFrontDistance);
+  LoadParam(root, "viewLeftDistance", this, Camera, setViewLeftDistance);
+  LoadParam(root, "viewRightDistance", this, Camera, setViewRightDistance);
+  LoadParam(root, "viewBehindDistance", this, Camera, setViewBehindDistance);
+  LoadParam(root, "viewNormalDistance", this, Camera, setViewNormalDistance);
+}
+*/
+
+void Camera::setViewTopFovy(float fovy)
+{
+  this->viewTopFovy = fovy;
+}
+
+void Camera::setViewFrontFovy(float fovy)
+{
+  this->viewFrontFovy = fovy;
+}
+
+void Camera::setViewLeftFovy(float fovy)
+{
+  this->viewLeftFovy = fovy;
+}
+
+void Camera::setViewRightFovy(float fovy)
+{
+  this->viewRightFovy = fovy;
+}
+
+void Camera::setViewBehindFovy(float fovy)
+{
+  this->viewBehindFovy = fovy;
+}
+
+void Camera::setViewNormalFovy(float fovy)
+{
+  this->viewNormalFovy = fovy;
+}
+
+void Camera::setViewTopDistance(float Distance)
+{
+  this->viewTopDistance = Distance;
+}
+
+void Camera::setViewFrontDistance(float Distance)
+{
+  this->viewFrontDistance = Distance;
+}
+
+void Camera::setViewLeftDistance(float Distance)
+{
+  this->viewLeftDistance = Distance;
+}
+
+void Camera::setViewRightDistance(float Distance)
+{
+  this->viewRightDistance = Distance;
+}
+
+void Camera::setViewBehindDistance(float Distance)
+{
+  this->viewBehindDistance = Distance;
+}
+
+void Camera::setViewNormalDistance(float Distance)
+{
+  this->viewNormalDistance = Distance;
 }
 
Index: trunk/src/world_entities/camera.h
===================================================================
--- trunk/src/world_entities/camera.h	(revision 10351)
+++ trunk/src/world_entities/camera.h	(revision 10368)
@@ -36,4 +36,5 @@
 
   Camera();
+  Camera(const TiXmlElement* root);
   virtual ~Camera();
 
@@ -43,8 +44,16 @@
 
   void setAspectRatio(float aspectRatio);
+  inline float getAspectRatio() {return this->aspectRatio;};
+
   void setClipRegion(float nearClip, float farClip);
 
   /** @param fovy new field of view factor (in degrees) */
-  void setFovy(float fovy) { this->fovy = fovy; };
+  inline void setFovy(float fovy) 
+  { 
+    this->fovy = fovy; 
+    this->toFovy = fovy;
+  };
+
+  inline float getFovy() {return this->fovy;};
   /** @param fovy new field of view factor (in degrees) to iterate to */
   void setToFovy(float toFovy) { this->toFovy = toFovy; };
@@ -58,4 +67,7 @@
   inline float distance(const PNode* node) const { return distance(node->getAbsCoor()); }
 
+  inline void setEventHandling(bool b) {this->eventHandling = b;}
+  inline bool getEventHandling() {return this->eventHandling;}
+
   void tick(float dt);
   void apply ();
@@ -64,6 +76,27 @@
   void process(const Event &event);
 
+  //virtual void loadParams(const TiXmlElement* root);
+
+  void              setViewTopFovy(float fovy);
+  void              setViewLeftFovy(float fovy);
+  void              setViewRightFovy(float fovy);
+  void              setViewBehindFovy(float fovy);
+  void              setViewFrontFovy(float fovy);
+  void              setViewNormalFovy(float fovy);
+
+  void              setViewTopDistance(float Distance);
+  void              setViewLeftDistance(float Distance);
+  void              setViewRightDistance(float Distance);
+  void              setViewBehindDistance(float Distance);
+  void              setViewFrontDistance(float Distance);
+  void              setViewNormalDistance(float Distance);
+
 private:
+
+  void              init();
+
   CameraTarget*     target;          //!< The Target of the Camera (where this Camera Looks at)
+
+  bool              eventHandling;    //!< True, if the Camera handles the processing of events itself. Set false to overwrite the standard handling.
 
   float             fovy;            //!< The field of view Angle (in degrees).
@@ -79,4 +112,19 @@
   Vector            viewVector;      //!< the direction of the camera view
   Vector            upVector;        //!< direction of the up vector
+
+  float             viewTopFovy;
+  float             viewLeftFovy;
+  float             viewRightFovy;
+  float             viewBehindFovy;
+  float             viewFrontFovy;
+  float             viewNormalFovy;
+
+  float             viewTopDistance;
+  float             viewLeftDistance;
+  float             viewRightDistance;
+  float             viewBehindDistance;
+  float             viewFrontDistance;
+  float             viewNormalDistance;
+  
 };
 
Index: trunk/src/world_entities/effects/trail.cc
===================================================================
--- trunk/src/world_entities/effects/trail.cc	(revision 10368)
+++ trunk/src/world_entities/effects/trail.cc	(revision 10368)
@@ -0,0 +1,312 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+
+   Trail system for engine output trails.
+   uses a catmull rom spline to interpolate the curve which is subdivided
+   into sections parts.
+   main-programmer: Marc Schaerer
+*/
+
+#include "trail.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+
+#include "quaternion.h"
+#include "vector.h"
+
+#include "graphics_engine.h"
+#include "material.h"
+#include "glincl.h"
+#include "state.h"
+#include "debug.h"
+
+
+
+#define trailAlphaMax 1.0f
+#define trailAlphaMin 0.2f
+
+ObjectListDefinition(Trail);
+CREATE_FACTORY(Trail);
+
+/**
+ * standart constructor
+ * @param maxLength maximum length of the trail. You will later need to set the actual length used.
+ * @param sections number of sections into which the trail polygon shall be splited. Higher number for more smooth curves
+ * @param radius radius of the trail cross.
+ * 
+ */
+Trail::Trail (float maxLength, int sections, float radius, PNode* parent)
+{
+  this->maxLength = maxLength;
+  this->length    = 1.0;
+  this->sections  = sections;
+  this->radius    = radius;
+  this->setParent( parent);
+
+  this->nodeList  = new Vector[sections];
+
+
+  this->init();
+}
+
+Trail::Trail (const TiXmlElement* root)
+{
+  this->init();
+
+  if( root)
+    this->loadParams(root);
+}
+
+/**
+ * destroys a Trail
+ */
+Trail::~Trail ()
+{
+  if (this->material)
+    delete this->material;
+  delete this->nodeList;
+}
+
+
+/**
+ * initializes the Trail
+ */
+void Trail::init()
+{
+  this->registerObject(this, Trail::_objectList);
+  this->setName("Trail");
+
+  this->material = new Material();
+  this->material->setIllum(3);
+  this->material->setDiffuse(1.0,1.0,1.0);
+  this->material->setSpecular(0.0,0.0,0.0);
+  this->material->setAmbient(1.0, 1.0, 1.0);
+
+  this->setAbsCoor(0, 0, 0);
+  this->setVisibiliy(true);
+
+  this->nodeList[0] = (this->getAbsCoor());
+  //PRINTF(0)("Trail data: N%i (%f,%f,%f)",0,this->getAbsCoor().x,this->getAbsCoor().y,this->getAbsCoor().z);
+  for( int i = 1; i < sections; i++)
+  {
+    this->nodeList[i] = (this->getAbsCoor());// - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections))));
+    //PRINTF(0)(" N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z);
+  }
+  //PRINTF(0)("\n");
+}
+
+
+/**
+ *  load params
+ * @param root TiXmlElement object
+ */
+void Trail::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams( root);
+}
+
+/**
+ * sets the material to load
+ * @param textureFile The texture-file to load
+ */
+void Trail::setTexture(const std::string& textureFile)
+{
+  this->material->setDiffuseMap(textureFile);
+}
+
+
+/**
+ * ticks the Trail
+ * @param dt the time to ticks
+ */
+void Trail::tick(float dt)
+{
+  // Update node positions
+  float len = 0;
+  float secLen  = this->maxLength / this->sections;
+  this->nodeList[0] = this->getAbsCoor();
+  this->nodeList[1] = this->getAbsCoor() - ((this->getParent()->getAbsDir().apply(Vector(1,0,0))).getNormalized() *  this->maxLength / sections);
+  for(int i = 2; i < this->sections; i++)
+  {
+    len = (this->nodeList[i-1] - this->nodeList[i]).len();
+    if( secLen < len) len = secLen;
+    this->nodeList[i] = this->nodeList[i-1] - (this->nodeList[i-1] - this->nodeList[i]).getNormalized()*len;
+  }
+}
+
+
+/**
+ * draws the trail
+ * the trail has a cone shape
+ */
+void Trail::draw() const
+{
+  if(!this->isVisible())
+    return;
+
+  Vector* Q = new Vector[4];
+  Vector targ;
+  Vector now, later;
+  float fact  = 1.0/this->sections;
+  float radzero, radone;
+
+  glPushAttrib(GL_ENABLE_BIT);
+  
+  glPushMatrix();
+  //glMatrixMode(GL_MODELVIEW);
+  //glLoadIdentity();
+  /*
+  glEnable(GL_BLEND);
+  glBlendFunc(GL_SRC_ALPHA,GL_ONE);
+  glDisable( GL_ALPHA_TEST);*/
+
+  glTranslatef(-this->getAbsCoor().x,-this->getAbsCoor().y,-this->getAbsCoor().z);
+  glScalef(1,1,1);
+  this->material->select();
+
+  //float alphaStep = 1.0 / this->sections;
+
+  glBegin(GL_TRIANGLE_STRIP);
+
+  // Alpha goes from 1.0 to 0.4 -> alphastep = .6 / this->sections
+  for( int i = 1; i < this->sections-1; i++)
+  {
+    radone  = this->radius * (1.0-i*fact + 0.2 * (float)rand()/(float)RAND_MAX);
+    radzero  = this->radius * (1.0-(i+1)*fact + 0.2 * (float)rand()/(float)RAND_MAX);
+
+    now   =  this->nodeList[i];
+    later =  this->nodeList[i+1];
+    if( i == 0)
+      targ  = this->getAbsDir().apply(Vector(1,0,0)).getNormalized();
+    else
+      targ  = (this->getAbsCoor() - now).getNormalized();
+
+    // horizontal polygon
+    Q[0]  = now + Vector(0,radone,0) ;
+    Q[3]  = now + Vector(0,-radone,0) ;
+    
+    glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z);
+	glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z);
+
+    if( i == this->sections - 1)
+    {
+      
+      Q[1]  = later + Vector(0,radzero,0) ;
+      Q[2]  = later + Vector(0,-radzero,0) ;
+      glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z);
+      glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
+    }
+
+
+  }
+  glEnd();
+  glBegin(GL_TRIANGLE_STRIP);
+  for( int i = this->sections-1; i > 0; i--)
+  {
+    radone  = this->radius * (1.0-i*fact + 0.2 * (float)rand()/(float)RAND_MAX);
+    radzero  = this->radius * (1.0-(i-1)*fact + 0.2 * (float)rand()/(float)RAND_MAX);
+
+    now   =  this->nodeList[i];
+    later =  this->nodeList[i-1];
+    if( i == 0)
+      targ  = this->getAbsDir().apply(Vector(1,0,0)).getNormalized();
+    else
+      targ  = (this->getAbsCoor() - now).getNormalized();
+
+    // horizontal polygon
+    Q[0]  = now + Vector(0,radone,0) ;
+    Q[3]  = now + Vector(0,-radone,0) ;
+
+	glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z+0.01f);
+	glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z+0.01f);
+
+    if( i == 1)
+    {
+        Q[1]  = later + Vector(0,radzero,0) ;
+        Q[2]  = later + Vector(0,-radzero,0) ;
+
+		glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z+0.01f);
+		glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z+0.01f);
+	}
+
+  }
+  glEnd();
+
+
+  glBegin(GL_TRIANGLE_STRIP);
+  for( int i = 1; i < this->sections-1; i++)
+  {
+    radone  = this->radius * (1.0-i*fact + 0.2 * (float)rand()/(float)RAND_MAX);
+    radzero  = this->radius * (1.0-(i+1)*fact + 0.2 * (float)rand()/(float)RAND_MAX);
+
+    now   =  this->nodeList[i];
+    later =  this->nodeList[i+1];
+    if( i == 0)
+      targ  = this->getAbsDir().apply(Vector(1,0,0)).getNormalized();
+    else
+      targ  = (this->getAbsCoor() - now).getNormalized();
+
+    // horizontal polygon
+    Q[0]  = now + targ.cross(Vector(0,radone,0)) ;
+    Q[3]  = now + targ.cross(Vector(0,-radone,0)) ;
+    
+	glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z);
+	glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z);
+
+    if( i == this->sections-1)
+    {
+      Q[1]  = later + targ.cross(Vector(0,radzero,0)) ;
+      Q[2]  = later + targ.cross(Vector(0,-radzero,0)) ;
+      glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z);
+      glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
+    }
+
+
+  }
+  glEnd();
+  glBegin(GL_TRIANGLE_STRIP);
+  for( int i = this->sections-1; i > 0; i--)
+  {
+    radone  = this->radius * (1.0-i*fact + 0.2 * (float)rand()/(float)RAND_MAX);
+    radzero  = this->radius * (1.0-(i-1)*fact + 0.2 * (float)rand()/(float)RAND_MAX);
+
+    now   =  this->nodeList[i];
+    later =  this->nodeList[i-1];
+    if( i == 0)
+      targ  = this->getAbsDir().apply(Vector(1,0,0)).getNormalized();
+    else
+      targ  = (this->getAbsCoor() - now).getNormalized();
+
+    // horizontal polygon
+    Q[0]  = now + targ.cross(Vector(0,radone,0)) ;
+    Q[3]  = now + targ.cross(Vector(0,-radone,0)) ;
+
+	glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x+0.01f,Q[0].y,Q[0].z);
+	glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x+0.01f,Q[3].y,Q[3].z);
+
+    if( i == 1)
+    {
+        Q[1]  = later + targ.cross(Vector(0,radzero,0)) ;
+        Q[2]  = later + targ.cross(Vector(0,-radzero,0)) ;
+
+		glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x+0.01f,Q[1].y,Q[1].z);
+		glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x+0.01f,Q[2].y,Q[2].z);
+	}
+
+  }
+  glEnd();
+  this->material->unselect();
+
+  glPopMatrix();
+  glPopAttrib();
+}
Index: trunk/src/world_entities/effects/trail.h
===================================================================
--- trunk/src/world_entities/effects/trail.h	(revision 10368)
+++ trunk/src/world_entities/effects/trail.h	(revision 10368)
@@ -0,0 +1,62 @@
+/*!
+ * @file trail.h
+ */
+
+#ifndef _TRAIL_H_
+#define _TRAIL_H_
+
+#include "world_entity.h"
+
+class Material;
+
+
+
+class Trail : public WorldEntity
+{
+  ObjectListDeclaration(Trail);
+  public:
+    Trail(float maxLength, int sections, float radius, PNode* parent);
+    Trail(const TiXmlElement* root = NULL);
+    virtual ~Trail();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    void setTexture(const std::string& textureFile);
+
+    virtual void tick(float dt);
+    virtual void draw() const;
+
+    /**
+     *  length of the trail.
+     */
+    inline void setLength(float length) { this->length = length;};
+    inline float getLength() { return this->length;};
+
+    /**
+     *  Amount of sections (parts) of the trail. The more, the rounder it will look
+     */
+    inline void setSections(int sections) { this->sections = sections;};
+    inline int getSections() { return this->sections;};
+
+    /**
+     *  Radius of the trail object
+     */
+    inline void setRadius(float radius) { this->radius = radius;};
+    inline float getRadius() { return this->radius;};
+
+  private:
+    void init();
+    inline Vector catmull(Vector P0, Vector P1, Vector P2, Vector P3, float t) const {return (P1*2 + (P2 - P0)*t + (P0*2 - P1*5- P2*4 - P3)*t*t + (P1*3 -P0 - P2*3 + P3)*t*t*t); };
+
+
+    Material*              material;
+
+    float maxLength;
+    float length;
+    float radius;
+    int   sections;
+
+    Vector*  nodeList;
+};
+
+#endif /* _TRAIL_H_ */
Index: trunk/src/world_entities/effects/wobblegrid.cc
===================================================================
--- trunk/src/world_entities/effects/wobblegrid.cc	(revision 10368)
+++ trunk/src/world_entities/effects/wobblegrid.cc	(revision 10368)
@@ -0,0 +1,215 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: David Hasenfratz
+*/
+
+#include "wobblegrid.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+
+#include "graphics_engine.h"
+#include "material.h"
+#include "glincl.h"
+#include "state.h"
+#include "grid.h"
+
+#include <assert.h>
+#include "debug.h"
+
+
+
+ObjectListDefinition(Wobblegrid);
+CREATE_FACTORY(Wobblegrid);
+
+/**
+ * Wobble Grids are grids which "wobble"
+ * Wobbling is realized through fixed center and sin wave outwards
+ * For the beginning the grid will be a 5x5
+ */
+
+/**
+ * standart constructor
+ */
+Wobblegrid::Wobblegrid (const TiXmlElement* root)
+{
+  this->size  = 5;
+
+  this->init();
+
+  if( root)
+    this->loadParams(root);
+}
+
+Wobblegrid::Wobblegrid (int size, const TiXmlElement* root)
+{
+  this->size  = size;
+
+  this->init();
+
+  if( root)
+    this->loadParams(root);
+}
+
+
+/**
+ * destroys a Wobblegrid
+ */
+Wobblegrid::~Wobblegrid ()
+{
+  if (this->material)
+    delete this->material;
+}
+
+
+/**
+ * initializes the Wobblegrid
+ */
+void Wobblegrid::init()
+{
+  this->registerObject(this, Wobblegrid::_objectList);
+  this->setName("Wobblegrid");
+
+  this->material = new Material();
+  this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+  this->setAbsCoor(0, 0, 0);
+  //this->setVisibiliy(true);
+  
+  this->subdivision = 5;
+
+  this->grid  = new Grid( this->size, this->size, this->subdivision, this->subdivision);
+  this->angularSpeed = M_PI; //180;
+  this->setModel(this->grid);
+
+  this->setUpdateFunction((*sinf));
+}
+
+
+/**
+ *  load params
+ * @param root TiXmlElement object
+ */
+void Wobblegrid::loadParams(const TiXmlElement* root)
+{
+  /*LoadParam(root, "texture", this->material, Material, setDiffuseMap)
+      .describe("the texture-file to load onto the Wobblegrid");
+
+  LoadParam(root, "size", this, Wobblegrid, setSize)
+  .describe("the size of the Wobblegrid in Pixels");*/
+}
+
+
+
+/**
+ * sets the material to load
+ * @param textureFile The texture-file to load
+ */
+void Wobblegrid::setTexture(const std::string& textureFile)
+{
+  this->material->setBlendFunc(GL_SRC_ALPHA,GL_ONE);
+  this->material->setDiffuseMap(textureFile);
+}
+
+
+/**
+ * ticks the Wobblegrid
+ * @param dt the time to ticks
+ */
+void Wobblegrid::tick(float dt)
+{
+  angle += dt * angularSpeed;
+  if (angle > 2 * M_PI)
+    angle -= 2 * M_PI;
+
+  //Vector vec;
+  float fac = 1.0 / (this->subdivision - 1);
+  for( int z=1; z < 4; z++)
+  {
+    for( int x=1; x < 4; x++)
+    {
+      //if(x==2 && z == 2)
+      //  continue;
+
+      Vector2D& vec = this->grid->texCoord(z*this->subdivision + x);
+      vec.y  = (x * fac + sgn(x-2)*updateWobble(angle)*fac/2.0);
+      vec.x  = (z * fac + sgn(z-2)*updateWobble(angle)*fac/2.0);
+    }
+  }
+  //this->grid->finalize();
+  this->orient();
+}
+
+
+/**
+ * draws the billboard
+ */
+void Wobblegrid::draw() const
+{
+
+//   this->material->select();
+//   WorldEntity::draw();
+//   return;
+
+
+  if( !this->isVisible())
+    return;
+
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+  glDisable(GL_FOG);
+
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  //glTranslatef(this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z);
+  //glTranslatef(0,0,0);
+  this->material->select();
+
+  glDisable(GL_BLEND);
+  glEnable( GL_ALPHA_TEST);
+  glAlphaFunc( GL_GEQUAL, .5);
+
+  glTranslatef (this->getAbsCoor ().x,
+                  this->getAbsCoor ().y,
+                  this->getAbsCoor ().z);
+
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+  //Quaternion  dir = Quaternion(this->getAbsDir().getSpacialAxisAngle(),view);
+  //this->setAbsDir(dir);
+  //glRotatef(this->angle, 0.0, 0.0, 1.0);
+  this->grid->draw();
+
+  glPopMatrix();
+
+  glPopAttrib();
+}
+
+void Wobblegrid::orient()
+{
+
+  Vector view = this->getAbsCoor() - State::getCameraNode()->getAbsCoor();
+//   view.normalize();
+
+  Vector up = Vector(0, 1, 0);
+//   if ( up.dot(view) == 0 )
+//     up = Vector(1, 0, 0);
+//   if ( up.dot(view) == 0 )
+//     up = Vector (0, 0, 1);
+
+  Vector h = up.cross(view.getNormalized());
+  up = h.cross(view.getNormalized());
+  Quaternion dir = Quaternion::lookAt( this->getAbsCoor(), this->getAbsCoor() + up, view);
+//   Quaternion dir = Quaternion::lookAt( Vector(), view, up);
+  this->setAbsDir(dir);
+}
Index: trunk/src/world_entities/effects/wobblegrid.h
===================================================================
--- trunk/src/world_entities/effects/wobblegrid.h	(revision 10368)
+++ trunk/src/world_entities/effects/wobblegrid.h	(revision 10368)
@@ -0,0 +1,49 @@
+/*!
+ * @file wobblegrid.h
+ */
+
+#ifndef _WOBBLEGRID_H
+#define _WOBBLEGRID_H
+
+#include "world_entity.h"
+
+class Material;
+class TiXmlElement;
+class Grid;
+
+class Wobblegrid : public WorldEntity
+{
+  ObjectListDeclaration(Wobblegrid);
+  public:
+    Wobblegrid(int size, const TiXmlElement* root = NULL);
+    Wobblegrid( const TiXmlElement* root = NULL);
+    virtual ~Wobblegrid();
+
+    void init();
+    void loadParams(const TiXmlElement* root);
+
+    void setTexture(const std::string& textureFile);
+
+    inline float sgn(float x) { if(likely(x==0)) return 0.0f; else return x / fabsf(x);};
+    virtual void tick(float dt);
+    virtual void draw() const;
+
+    inline void setUpdateFunction(float (*updateFct)(float value)) { if( updateFct)  this->updateWobble = updateFct;};
+
+  private:
+    float (*updateWobble)(float value);
+
+    void orient();
+
+    Material*        material;
+    Grid*            grid;	//!< current projected positions transformed into billboard state
+
+    int subdivision;
+
+    int size;
+
+    float angle;
+    float angularSpeed;
+};
+
+#endif /* _WOBBLEGRID_H */
Index: trunk/src/world_entities/elements/glgui_energywidget.h
===================================================================
--- trunk/src/world_entities/elements/glgui_energywidget.h	(revision 10351)
+++ trunk/src/world_entities/elements/glgui_energywidget.h	(revision 10368)
@@ -26,4 +26,8 @@
     void setValue(float value);
 
+    inline GLGuiWidget* getNameWidget() {return &this->_name;};
+    inline GLGuiWidget* getValueWidget() {return &this->_valueText;};
+    inline GLGuiWidget* getBarWidget() {return &this->_bar;};
+
   protected:
     virtual void resize();
Index: trunk/src/world_entities/elements/glgui_energywidgetvertical.cc
===================================================================
--- trunk/src/world_entities/elements/glgui_energywidgetvertical.cc	(revision 10368)
+++ trunk/src/world_entities/elements/glgui_energywidgetvertical.cc	(revision 10368)
@@ -0,0 +1,166 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "glgui_energywidgetvertical.h"
+
+#include "multi_type.h"
+#include <iostream>
+#include "math.h"
+#include "glgui_image.h"
+
+namespace OrxGui
+{
+  /**
+   * @brief standard constructor
+   */
+  GLGuiEnergyWidgetVertical::GLGuiEnergyWidgetVertical ()
+  {
+    this->_bar = new GLGuiBar();
+    this->_valueText = new GLGuiText();
+    this->_image = new GLGuiImage();
+
+    this->setAbsDir2D(270);
+    this->setBackgroundTexture(Texture());
+    this->setBackgroundColor(Color(1,1,1,0));
+    this->setBorderTop(10);
+    this->setBorderLeft(10);
+    this->setBorderRight(10);
+    this->setBorderBottom(10);
+    this->setWidgetSize(120,50);
+
+    this->_bar->setParent2D(this);
+    this->_bar->setBackgroundTexture(Texture());
+    this->_bar->setBackgroundColor(Color(0,0,0,0));
+    this->_bar->setForegroundTexture("maps/gui_element_background_faded.png");
+    this->_bar->setForegroundColor(Color::green);
+    this->_bar->setChangedValueColor(Color(1,0,0,0.2));
+    this->_bar->setBorderTop(0);
+    this->_bar->setBorderLeft(0);
+    this->_bar->setBorderRight(0);
+    this->_bar->setBorderBottom(0);
+    this->_bar->setWidgetSize(100,30);
+    //this->_bar.setRelCoor2D(borderLeft(), 0);
+    this->_bar->setRelCoor2D(0,0);
+
+    this->_image->setParent2D(this);
+    this->_image->setBorderTop(0);
+    this->_image->setBorderLeft(0);
+    this->_image->setBorderRight(0);
+    this->_image->setBorderBottom(0);
+    this->_image->setWidgetSize(30,30);
+    this->_image->setForegroundColor(Color(1,1,1,0.6));
+    this->_image->setBackgroundColor(Color(1,1,1,0));
+    this->_image->setBackgroundTexture(Texture());
+    this->_image->loadImageFromFile("maps/evil-flower.png");
+    //this->_image.setRelCoor2D(borderLeft(), borderTop() + this->_bar.getSizeX2D());
+    this->_image->setRelCoor2D(0,0);
+    this->_image->setRelDir2D(90);
+    this->_image->setVisibility(true);
+
+
+    this->_valueText->setParent2D(this->_bar);
+    this->_valueText->setWidgetSize(100,20);
+    //this->_valueText.setRelCoor2D(borderLeft(), borderTop() + this->_bar.getSizeX2D());
+    this->_valueText->setAbsCoor2D(-15,-20);
+    this->_valueText->setChangedTextColor(Color::white);
+    this->_valueText->setForegroundColor(Color::white);
+    this->_valueText->setBackgroundTexture(Texture());
+    this->_valueText->setBackgroundColor(Color(0,0,0,0));
+  }
+
+
+  /**
+   * @brief standard deconstructor
+   */
+  GLGuiEnergyWidgetVertical::~GLGuiEnergyWidgetVertical ()
+  {
+
+    if ( this->_valueText )
+    {
+      delete this->_valueText;
+      this->_valueText = NULL;
+    }
+    
+    if ( this->_image )
+    {
+      delete this->_image;
+      this->_image = NULL;
+    }
+   
+    /*
+    if ( this->_bar )
+    {
+      delete this->_bar;
+      this->_bar = NULL;
+    }
+    */
+  }
+
+  void GLGuiEnergyWidgetVertical::setMaximum(float max)
+  {
+    this->_bar->setMaximum(max);
+  }
+
+  void GLGuiEnergyWidgetVertical::setValue(float value)
+  {
+    MultiType val(value);
+    //MultiType val(200.00);
+    val.setType(MT_INT);
+
+
+    this->_bar->setValue(value);
+    this->_bar->setForegroundColor(Color::slerpHSVColor(Color::red, Color::green, value/this->_bar->maximum()));
+    //this->_bar.setFrontColor(Color(1,1,1,1), true);
+    this->_valueText->setText(val.getString());
+    //this->_valueText.setText("asdfas");
+  }
+
+  void GLGuiEnergyWidgetVertical::setDisplayedImage(const std::string& imageName)
+  {
+    this->_image->loadImageFromFile(imageName);
+  }
+
+  void GLGuiEnergyWidgetVertical::resize()
+  {
+    Vector2D widgetSize = this->getSize2D();
+
+    this->setBorderTop(widgetSize.y * 0.1);
+    this->setBorderBottom(widgetSize.y * 0.1);
+    this->setBorderLeft(widgetSize.x * 0.2);
+    this->setBorderRight(widgetSize.x * 0.2);
+    
+    this->_bar->setWidgetSize(widgetSize.x * 0.8, widgetSize.y * 0.6);
+    this->_image->setWidgetSize(widgetSize.y * 0.6, widgetSize.y * 0.6);
+    this->_valueText->setWidgetSize(widgetSize.x* 0.8, widgetSize.y * 0.4);
+  }
+
+
+  void GLGuiEnergyWidgetVertical::showing()
+  {
+   
+    this->_bar->show();
+    this->_image->show();
+    this->_valueText->show();
+  }
+
+  void GLGuiEnergyWidgetVertical::hiding()
+  {
+    this->_image->hide();
+    this->_valueText->hide();
+    this->_bar->hide();
+  }
+}
Index: trunk/src/world_entities/elements/glgui_energywidgetvertical.h
===================================================================
--- trunk/src/world_entities/elements/glgui_energywidgetvertical.h	(revision 10368)
+++ trunk/src/world_entities/elements/glgui_energywidgetvertical.h	(revision 10368)
@@ -0,0 +1,45 @@
+/*!
+ * @file glgui_energywidgetvertical.h
+ * @brief Definition of an EnergyWidgetVertical, that displays a bar and a Text
+*/
+
+#ifndef _GLGUI_ENERGY_WIDGET_VERTICAL_H
+#define _GLGUI_ENERGY_WIDGET_VERTICAL_H
+
+//#include "glgui_box.h"
+#include "glgui_bar.h"
+#include "glgui_text.h"
+#include "glgui_image.h"
+
+namespace OrxGui
+{
+
+  //! A class for ...
+  class GLGuiEnergyWidgetVertical : public GLGuiWidget
+  {
+
+  public:
+    GLGuiEnergyWidgetVertical();
+    virtual ~GLGuiEnergyWidgetVertical();
+
+    void setMaximum(float max);
+    void setValue(float value);
+    void setDisplayedImage(const std::string& imageName);
+
+    inline GLGuiImage* getImageWidget() {return this->_image;};
+    inline GLGuiText* getValueWidget() {return this->_valueText;};
+    inline GLGuiBar* getBarWidget() {return this->_bar;};
+
+  protected:
+    virtual void resize();
+    virtual void showing();
+    virtual void hiding();
+
+  private:
+    GLGuiImage*              _image;
+    GLGuiText*               _valueText;
+    GLGuiBar*                _bar;
+
+  };
+}
+#endif /* _GLGUI_ENERGY_WIDGET_VERTICAL_H */
Index: trunk/src/world_entities/elements/glgui_radar.cc
===================================================================
--- trunk/src/world_entities/elements/glgui_radar.cc	(revision 10351)
+++ trunk/src/world_entities/elements/glgui_radar.cc	(revision 10368)
@@ -122,5 +122,5 @@
           this->_dotLists[i].positions.push_back(Vector2D(((*it)->getAbsCoor().x - _centerNode->getAbsCoor().x) * this->getSizeX2D() ,
                                                  ((*it)->getAbsCoor().z - _centerNode->getAbsCoor().z) * this->getSizeY2D()  )
-                                                 / (2.0f * _range));
+                                                 / (3.0f * _range));
         }
 
Index: trunk/src/world_entities/particles/emitter_node.cc
===================================================================
--- trunk/src/world_entities/particles/emitter_node.cc	(revision 10368)
+++ trunk/src/world_entities/particles/emitter_node.cc	(revision 10368)
@@ -0,0 +1,98 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: Patrick Boenzli
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
+
+#include "emitter_node.h"
+
+#include "particle_system.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "debug.h"
+
+ObjectListDefinition(EmitterNode);
+//CREATE_FAST_FACTORY(EmitterNode);
+
+/**
+ *  standard constructor
+*/
+EmitterNode::EmitterNode( float lifetime)
+{
+  this->registerObject(this, EmitterNode::_objectList);
+
+  this->toList(OM_ENVIRON);
+
+  this->system = NULL;
+  this->emitter = NULL;
+  this->lifeCycle = 0.0;
+  this->lifeSpan = lifetime;
+
+  this->setParent( PNode::getNullParent());
+}
+
+/**
+ *  standard destructor
+
+   removes the EmitterSystem from the ParticleEngine
+*/
+EmitterNode::~EmitterNode ()
+{
+  this->emitter->setSystem(NULL);
+  this->removeNode();
+}
+
+/**
+ *  loads a EmitterNode from a XML-element
+ * @param root the XML-element to load from
+*/
+void EmitterNode::loadParams(const TiXmlElement* root)
+{
+  PNode::loadParams(root);
+
+  LoadParam(root, "life-time", this, EmitterNode, setLifetime)
+    .describe("Amount of time this emitter node shall remain");
+}
+
+bool EmitterNode::start()
+{
+  this->started  = true;
+
+  this->emitter->start();
+  this->emitter->setSystem( this->system);
+
+  return this->started;
+}
+
+void EmitterNode::tick(float dt)
+{
+
+  if( !this->started)
+    return;
+
+  this->lifeCycle += dt/this->lifeSpan;
+
+  if( this->lifeCycle >= 1.0f)
+  {
+//   this->removeNode();
+ //   this->emitter->stop();
+    this->emitter->setSystem(NULL);
+    this->started = false;
+    this->toList(OM_NULL);
+
+//    this->destroy( NULL );
+  }
+  this->shiftCoor(this->velocity * dt);
+}
Index: trunk/src/world_entities/particles/emitter_node.h
===================================================================
--- trunk/src/world_entities/particles/emitter_node.h	(revision 10368)
+++ trunk/src/world_entities/particles/emitter_node.h	(revision 10368)
@@ -0,0 +1,48 @@
+/*!
+ * @file emitter_node.h
+  *  Definition of a EmitterNode
+  *  An emitter node is a node that takes an emitter and a particle system and keeps them alive for a given amount of time.
+*/
+
+#ifndef _EMITTER_NODE_H
+#define _EMITTER_NODE_H
+
+#include "world_entity.h"
+#include "dot_emitter.h"
+#include "particle_system.h"
+
+// FORWARD DECLARATION
+class DotEmitter;
+class ParticleEmitter;
+class TiXmlElement;
+
+//! A class to handle an Emitter.
+class EmitterNode : public WorldEntity
+{
+  ObjectListDeclaration(EmitterNode);
+public:
+  EmitterNode(float lifetime);
+  virtual ~EmitterNode();
+
+  virtual void loadParams(const TiXmlElement* root = NULL);
+  
+  virtual void tick( float time);
+
+  bool start();
+  inline void setVelocity(Vector velocity) { this->velocity = velocity;};
+
+  inline void setupParticle(DotEmitter* emitter, ParticleSystem* system) { this->emitter = emitter; this->emitter->setParent( this); this->system = system;} ;
+  void setLifetime( float lifeTime) { this->lifeSpan  = lifeTime;};
+
+private:
+  float           lifeSpan;           //!< Life time of this emitter node
+  float           lifeCycle;          
+  bool            started;            //!< was this emitter node started?
+
+  Vector          velocity;           //!< Velocity per second of the node
+
+  DotEmitter*  emitter;          //!< emitter which is held and kept alive
+  ParticleSystem*   system;           //!< system to be used on the particle emitter
+};
+
+#endif /* _EMITTER_NODE_H */
Index: trunk/src/world_entities/particles/particle_emitter.h
===================================================================
--- trunk/src/world_entities/particles/particle_emitter.h	(revision 10351)
+++ trunk/src/world_entities/particles/particle_emitter.h	(revision 10368)
@@ -36,5 +36,5 @@
   void start();
   void stop();
-  void tick(float dt);
+  virtual void tick(float dt);
 
   void setSystem(ParticleSystem* system);
@@ -74,5 +74,5 @@
   float           momentumRandom;    //!< The random variation of the Momentum.
 
-private:
+//private:
   ParticleSystem* system;            //!< The ParticleSystem this Emitter Emits into.
   float           saveTime;          //!< The time that was missing by the last Tick (otherwise there would be no emission when framefate is too big).
Index: trunk/src/world_entities/playable.cc
===================================================================
--- trunk/src/world_entities/playable.cc	(revision 10351)
+++ trunk/src/world_entities/playable.cc	(revision 10368)
@@ -44,6 +44,6 @@
 
 Playable::Playable()
-    : weaponMan(this),
-    supportedPlaymodes(Playable::Full3D),
+    : weaponMan(this)
+    ,supportedPlaymodes(Playable::Full3D),
     playmode(Playable::Full3D)
 {
Index: trunk/src/world_entities/playable.h
===================================================================
--- trunk/src/world_entities/playable.h	(revision 10351)
+++ trunk/src/world_entities/playable.h	(revision 10368)
@@ -71,5 +71,5 @@
   void setCameraMode(unsigned int cameraMode = 0);
   bool playmodeSupported(Playable::Playmode playmode) const { return this->supportedPlaymodes & playmode; };
-  bool setPlaymode(Playable::Playmode playmode);
+  virtual bool setPlaymode(Playable::Playmode playmode);
   Playable::Playmode getPlaymode() const { return this->playmode; };
   virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f) = 0;
@@ -117,11 +117,15 @@
   void unregisterEvent(int eventType);
 
+protected:
+  WeaponManager         weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
+  bool                  bFire;              //!< If the Ship is firing.
+  short                 supportedPlaymodes; //!< What Playmodes are Supported in this Playable.
+  Playable::Playmode    playmode;           //!< The current playmode.
+
 private:
-  WeaponManager         weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
   std::vector<int>      events;             //!< A list of Events, that are captured for this playable
 
   Player*               currentPlayer;      //!< The Player currently connected to this Playable (the one that has controll) otherwise NULL
 
-  bool                  bFire;              //!< If the Ship is firing.
   int                   oldFlags;           //!< Used for synchronisation
 
@@ -131,6 +135,4 @@
 
   bool                  bDead;
-  short                 supportedPlaymodes; //!< What Playmodes are Supported in this Playable.
-  Playable::Playmode    playmode;           //!< The current playmode.
 
   float                 enterRadius;        //!< How far one can be away from the Playable to enter it.
Index: trunk/src/world_entities/player.cc
===================================================================
--- trunk/src/world_entities/player.cc	(revision 10351)
+++ trunk/src/world_entities/player.cc	(revision 10368)
@@ -16,4 +16,5 @@
 #include "player.h"
 #include "playable.h"
+#include "space_ships/space_ship.h"
 
 #include "event_handler.h"
@@ -73,6 +74,9 @@
     PRINTF(4)("Enter new Playable\n");
     this->playable = playable;
-    this->_hud.setEnergyWidget(this->playable->getHealthWidget());
-    this->_hud.setWeaponManager(&this->playable->getWeaponManager());
+    this->_hud.setArmorWidget(this->playable->getHealthWidget());
+    if (dynamic_cast<SpaceShip*>(this->playable) != 0)
+      this->_hud.setWeaponManager(&this->playable->getWeaponManager(), &dynamic_cast<SpaceShip*>(this->playable)->getWeaponManagerSecondary());
+    else
+      this->_hud.setWeaponManager(&this->playable->getWeaponManager());
 
     this->playable->setPlayer(this);
@@ -94,5 +98,10 @@
 void Player::weaponConfigChanged()
 {
-  this->_hud.updateWeaponManager();
+  //this->_hud.updateWeaponManager();
+
+  if (dynamic_cast<SpaceShip*>(this->playable) != 0)
+      this->_hud.setWeaponManager(&this->playable->getWeaponManager(), &dynamic_cast<SpaceShip*>(this->playable)->getWeaponManagerSecondary());
+    else
+      this->_hud.setWeaponManager(&this->playable->getWeaponManager());
 }
 
@@ -128,2 +137,3 @@
 }
 
+
Index: trunk/src/world_entities/player.h
===================================================================
--- trunk/src/world_entities/player.h	(revision 10351)
+++ trunk/src/world_entities/player.h	(revision 10368)
@@ -1,3 +1,3 @@
-/*!
+ /*!
  * @file player.h
  * Implements a basic playable WorldEntity
@@ -46,5 +46,5 @@
   private:
     Playable*         playable;                 //!< The one we controll or NULL if none
-    Hud               _hud;                      //!< The HUD to be displayed for this Player.
+    Hud               _hud;                     //!< The HUD to be displayed for this Player.
 };
 
Index: trunk/src/world_entities/projectiles/acid_splash.cc
===================================================================
--- trunk/src/world_entities/projectiles/acid_splash.cc	(revision 10368)
+++ trunk/src/world_entities/projectiles/acid_splash.cc	(revision 10368)
@@ -0,0 +1,183 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer
+   co-programmer: Benjamin Grauer
+
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "acid_splash.h"
+
+#include "state.h"
+
+//#include "space_ships/space_ship.h"
+
+#include <cassert>
+#include "debug.h"
+
+//#include "static_model.h"
+
+#include "effects/wobblegrid.h"
+
+
+
+ObjectListDefinition(AcidSplash);
+CREATE_FAST_FACTORY_STATIC(AcidSplash);
+
+/**
+ *  standard constructor
+*/
+AcidSplash::AcidSplash () : Projectile()
+{
+  this->registerObject(this, AcidSplash::_objectList);
+
+  srand(time(0));   //initialize Random Nomber Generator
+
+  //this->loadModel("models/projectiles/laser.obj");
+
+  this->setMinEnergy(1);
+  this->setHealthMax(0);
+  this->lifeSpan = 3.0;
+  this->angle     = 0;
+
+  this->grid = new Wobblegrid( 5);
+  this->grid->setParent( this);
+
+
+  int rnd = int(rand() % 3);
+
+  switch (rnd){
+    case 0:
+      this->grid->setTexture( "maps/acid2.png");
+      break;
+    case 1:
+      this->grid->setTexture( "maps/acid3.png");
+      break;
+    case 2:
+      this->grid->setTexture( "maps/blub.png");
+      break;
+    default:
+      this->grid->setTexture( "maps/acid2.png");
+  }
+//   if (rand()/2 == 0) //!<Randomized Textrures
+//     this->grid->setTexture( "maps/acid3.png");
+//   else
+//     this->grid->setTexture( "maps/blub.png");
+
+  this->grid->toList(OM_ENVIRON); 
+}
+
+
+/**
+ *  standard deconstructor
+ *
+ */
+AcidSplash::~AcidSplash ()
+{
+  // delete this->emitter;
+  //delete this->grid;
+  this->grid->toList(OM_DEAD);
+  
+}
+
+
+void AcidSplash::activate()
+{
+  this->origList = this->getOMListNumber();
+  this->toList(OM_ENVIRON);
+ // this->unhide();
+  this->grid->setVisibiliy(true);
+
+  this->setPhysDamage(10);
+  this->setElecDamage(0);
+  this->setHealth(0);
+}
+
+
+void AcidSplash::deactivate()
+{
+  this->lifeCycle = 0.0;
+
+ // this->hide();
+  this->grid->setVisibiliy(false);
+  this->lifeCycle = 0.0;
+  this->toList(OM_NULL);
+  //this->toList(OM_DEAD);
+  this->removeNode();
+  
+  AcidSplash::fastFactory->kill(this);
+}
+
+/*
+void AcidSplash::collidesWith(WorldEntity* entity, const Vector& location)
+{
+
+  if (this->hitEntity != entity)
+    this->destroy( entity );
+  this->hitEntity = entity;
+  //dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
+  //this->destroy(this);
+  this->deactivate();
+  
+//   return;
+
+  //dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage());
+  //entity->destroy(this);
+  //this->deactivate();
+}
+*/
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void AcidSplash::tick (float dt)
+{
+  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt))
+    this->deactivate();
+
+  this->angle += this->rotationSpeed * dt;
+
+  this->grid->tick(dt);
+
+  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
+  {
+    if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
+    {
+      (*eIterator)->hit (this->getDamage(),this);
+      this->deactivate();
+    }
+  }
+
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void AcidSplash::destroy (WorldEntity* killer)
+{
+  this->deactivate();
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY AcidSplash\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+}
+
+
+void AcidSplash::draw () const
+{
+  this->grid->draw();
+}
Index: trunk/src/world_entities/projectiles/acid_splash.h
===================================================================
--- trunk/src/world_entities/projectiles/acid_splash.h	(revision 10368)
+++ trunk/src/world_entities/projectiles/acid_splash.h	(revision 10368)
@@ -0,0 +1,45 @@
+/*!
+ * @file acid_splash.h
+ * @brief acid splash projectile
+*/
+
+#ifndef _ACIDSPLASH_H
+#define _ACIDSPLASH_H
+
+#include "projectile.h"
+
+class Vector;
+class Weapon;
+class FastFactory;
+class Wobblegrid;
+
+class AcidSplash : public Projectile
+{
+  ObjectListDeclaration(AcidSplash);
+  public:
+    AcidSplash ();
+    virtual ~AcidSplash ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+ //   virtual void collidesWith(WorldEntity* entity, const Vector& location);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+  private:
+    static FastFactory*               fastFactory;
+    Wobblegrid*                       grid;
+
+    float                             angle;
+    static const float                rotationSpeed = 1080;
+
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+};
+
+#endif /* _ACIDSPLASH_H */
Index: trunk/src/world_entities/projectiles/hbolt.cc
===================================================================
--- trunk/src/world_entities/projectiles/hbolt.cc	(revision 10368)
+++ trunk/src/world_entities/projectiles/hbolt.cc	(revision 10368)
@@ -0,0 +1,196 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Nicolas Schlumberger, Marc Schaerrer
+   co-programmer: Benjamin Grauer
+
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "hbolt.h"
+
+#include "state.h"
+#include "model.h"
+
+#include "particles/dot_emitter.h"
+#include "particles/sprite_particles.h"
+
+#include <cassert>
+#include "debug.h"
+
+// #include "effects/billboard.h"
+#include "space_ships/space_ship.h"
+#include "npcs/npc.h"
+
+ObjectListDefinition(HBolt);
+CREATE_FAST_FACTORY_STATIC(HBolt);
+
+/**
+ *  standard constructor
+*/
+HBolt::HBolt () : Projectile()
+{
+  this->registerObject(this, HBolt::_objectList);
+
+  this->loadModel("models/projectiles/hbolt.obj",1.1);
+
+  this->setMinEnergy(10);
+  this->setHealthMax(0);
+  this->lifeSpan = 2.0;
+
+  this->angle = 0;
+  this->rotationSpeed = 600;
+
+  this->emitter = new DotEmitter(100, 5, M_2_PI);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+  this->emitter->setEmissionRate(300.0);
+  this->emitter->setEmissionVelocity(50.0);
+
+  this->halo = new Billboard();
+  this->halo->setSize(.65, .65);
+  this->halo->setTexture("hbolt_halo2.png");
+
+}
+
+
+/**
+ *  standard deconstructor
+*/
+HBolt::~HBolt ()
+{
+  // delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (HBolt::explosionParticles != NULL && HBolt::objectList().size() <= 1)
+  {
+    //if (ClassList::exists(HBolt::explosionParticles, CL_PARTICLE_SYSTEM))
+    //  delete HBolt::explosionParticles;
+    PRINTF(1)("Deleting HBolt Particles\n");
+    HBolt::explosionParticles = NULL;
+  }
+
+}
+
+SpriteParticles* HBolt::explosionParticles = NULL;
+
+void HBolt::activate()
+{
+  this->origList = this->getOMListNumber();
+  this->toList(OM_ENVIRON);
+  if (unlikely(HBolt::explosionParticles == NULL))
+  {
+    HBolt::explosionParticles = new SpriteParticles(1000);
+    HBolt::explosionParticles->setName("HBoltExplosionParticles");
+    HBolt::explosionParticles->setLifeSpan(.5, .3);
+    HBolt::explosionParticles->setRadius(0.0, 10.0);
+    HBolt::explosionParticles->setRadius(.5, 6.0);
+    HBolt::explosionParticles->setRadius(1.0, 3.0);
+    HBolt::explosionParticles->setColor(0.0, 1,1,0,.9);
+    HBolt::explosionParticles->setColor(0.5, .8,.8,0,.5);
+    HBolt::explosionParticles->setColor(1.0, .8,.8,.7,.0);
+  }
+
+  this->setPhysDamage(100);
+  this->setHealth(0);
+}
+
+
+void HBolt::deactivate()
+{
+  assert (HBolt::explosionParticles != NULL);
+  HBolt::explosionParticles->removeEmitter(this->emitter);
+  this->lifeCycle = 0.0;
+
+  this->toList(OM_DEAD);
+  this->removeNode();
+  HBolt::fastFactory->kill(this);
+
+}
+
+
+void HBolt::hit (float damage, WorldEntity* entity )
+{
+  printf("Collision with HBolt\n");
+  if (this->hitEntity != entity && entity->isA(NPC::staticClassID()) || entity == this->target)
+    this->destroy( entity );
+  this->hitEntity = entity;
+ // dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage());
+  this->deactivate();
+}
+
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void HBolt::tick (float dt)
+{
+  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt))
+    this->deactivate();
+
+  this->angle += this->rotationSpeed * dt;
+
+  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
+  {
+    if( ((*eIterator)->getOMListNumber() != (this->origList -1))   && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
+    {
+      (*eIterator)->hit (this->getDamage(),this);
+      this->deactivate();
+  PRINTF(0)("HBolt destroyed\n");
+    }
+  }
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void HBolt::destroy (WorldEntity* killer)
+{
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY HBolt\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+
+  this->emitter->setSystem(HBolt::explosionParticles);
+}
+
+
+void HBolt::draw () const
+{
+
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+  glDisable(GL_FOG);
+
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+
+  glTranslatef (this->getAbsCoor ().x,
+                  this->getAbsCoor ().y,
+                  this->getAbsCoor ().z);
+
+  this->halo->draw();
+
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+  glRotatef(this->angle, 0.0, 0.0, 1.0);
+
+  this->getModel()->draw();
+
+  glPopMatrix();
+  glPopAttrib();
+
+}
Index: trunk/src/world_entities/projectiles/hbolt.h
===================================================================
--- trunk/src/world_entities/projectiles/hbolt.h	(revision 10368)
+++ trunk/src/world_entities/projectiles/hbolt.h	(revision 10368)
@@ -0,0 +1,51 @@
+/*!
+ * @file hhbolt.h
+ * @brief heavy blaster hbolt
+*/
+
+#ifndef _HBOLT_H
+#define _HBOLT_H
+
+#include "projectile.h"
+#include "effects/billboard.h"
+
+class Vector;
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+
+class HBolt : public Projectile
+{
+  ObjectListDeclaration(HBolt);
+  public:
+    HBolt ();
+    virtual ~HBolt ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void hit (float damage, WorldEntity* entity);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+  private:
+    static FastFactory*               fastFactory;
+
+    static SpriteParticles*           explosionParticles;
+
+    ParticleEmitter*                  emitter;
+
+    float                             angle;
+    float                             rotationSpeed;
+
+    Billboard*                        halo;
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+};
+
+#endif /* _HBOLT_H */
Index: trunk/src/world_entities/projectiles/lbolt.cc
===================================================================
--- trunk/src/world_entities/projectiles/lbolt.cc	(revision 10368)
+++ trunk/src/world_entities/projectiles/lbolt.cc	(revision 10368)
@@ -0,0 +1,193 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Nicolas Schlumberger, Marc Schaerrer
+   co-programmer: Benjamin Grauer
+
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "lbolt.h"
+
+#include "state.h"
+#include "model.h"
+
+#include "particles/dot_emitter.h"
+#include "particles/sprite_particles.h"
+#include "npcs/npc.h"
+
+#include <cassert>
+#include "debug.h"
+
+#include "space_ships/space_ship.h"
+
+
+
+ObjectListDefinition(LBolt);
+CREATE_FAST_FACTORY_STATIC(LBolt);
+
+/**
+ *  standard constructor
+*/
+LBolt::LBolt () : Projectile()
+{
+  this->registerObject(this, LBolt::_objectList);
+
+  this->loadModel("models/projectiles/lbolt.obj");
+
+  this->setMinEnergy(1);
+  this->setHealthMax(0);
+  this->lifeSpan = 1.0;
+
+  this->emitter = new DotEmitter(100, 5, M_2_PI);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+  this->emitter->setEmissionRate(300.0);
+  this->emitter->setEmissionVelocity(50.0);
+
+  this->angle = 0;
+  this->rotationSpeed = 130;
+
+  this->halo = new Billboard();
+  this->halo->setSize(.35, .35);
+  this->halo->setTexture("hbolt_halo.png");
+
+
+}
+
+
+/**
+ *  standard deconstructor
+*/
+LBolt::~LBolt ()
+{
+  // delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (LBolt::explosionParticles != NULL && LBolt::objectList().size() <= 1)
+  {
+    //if (ClassList::exists(LBolt::explosionParticles, CL_PARTICLE_SYSTEM))
+    //  delete LBolt::explosionParticles;
+    PRINTF(1)("Deleting LBolt Particles\n");
+    LBolt::explosionParticles = NULL;
+  }
+
+}
+
+SpriteParticles* LBolt::explosionParticles = NULL;
+
+void LBolt::activate()
+{
+  this->origList = this->getOMListNumber();
+  this->toList(OM_ENVIRON);
+  if (unlikely(LBolt::explosionParticles == NULL))
+  {
+    LBolt::explosionParticles = new SpriteParticles(1000);
+    LBolt::explosionParticles->setName("BoltExplosionParticles");
+    LBolt::explosionParticles->setLifeSpan(.5, .3);
+    LBolt::explosionParticles->setRadius(0.0, 10.0);
+    LBolt::explosionParticles->setRadius(.5, 6.0);
+    LBolt::explosionParticles->setRadius(1.0, 3.0);
+    LBolt::explosionParticles->setColor(0.0, 1,1,0,.9);
+    LBolt::explosionParticles->setColor(0.5, .8,.8,0,.5);
+    LBolt::explosionParticles->setColor(1.0, .8,.8,.7,.0);
+  }
+
+  this->setDamage(5);
+  this->setHealth(0);
+}
+
+
+void LBolt::deactivate()
+{
+  assert (LBolt::explosionParticles != NULL);
+  LBolt::explosionParticles->removeEmitter(this->emitter);
+  this->lifeCycle = 0.0;
+
+  this->toList(OM_DEAD);
+  this->removeNode();
+  LBolt::fastFactory->kill(this);
+}
+
+
+void LBolt::hit (float damage, WorldEntity* entity )
+{
+  PRINTF(0)("Collision with LBolt\n");
+  if (this->hitEntity != entity && entity->isA(NPC::staticClassID()))
+    this->destroy( entity );
+  this->hitEntity = entity;
+  this->deactivate();
+}
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void LBolt::tick (float dt)
+{
+  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt))
+    this->deactivate();
+
+  angle += rotationSpeed * dt;
+
+  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
+  {
+    if( ((*eIterator)->getOMListNumber() != (this->origList -1))   && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
+    {
+      (*eIterator)->hit (this->getDamage(),this);
+      this->deactivate();
+  PRINTF(0)("LBolt destroyed\n");
+    }
+  }
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void LBolt::destroy (WorldEntity* killer)
+{
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY LBolt\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+
+  this->emitter->setSystem(LBolt::explosionParticles);
+}
+
+
+void LBolt::draw () const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  //glDisable(GL_LIGHTING);
+
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+
+  glRotatef(angle, 1.0, 0.0, 0.0);
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  this->getModel()->draw();
+
+  this->halo->draw();
+
+  glPopMatrix();
+
+  glPopAttrib();
+}
+
Index: trunk/src/world_entities/projectiles/lbolt.h
===================================================================
--- trunk/src/world_entities/projectiles/lbolt.h	(revision 10368)
+++ trunk/src/world_entities/projectiles/lbolt.h	(revision 10368)
@@ -0,0 +1,52 @@
+/*!
+ * @file lbolt.h
+ * @brief light blaster lbolt
+*/
+
+#ifndef _LBOLT_H
+#define _LBOLT_H
+
+#include "projectile.h"
+#include "effects/billboard.h"
+
+class Vector;
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+
+class LBolt : public Projectile
+{
+  ObjectListDeclaration(LBolt);
+  public:
+    LBolt ();
+    virtual ~LBolt ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void hit (float damage, WorldEntity* entity);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+
+  private:
+    static FastFactory*               fastFactory;
+
+    static SpriteParticles*           explosionParticles;
+
+    ParticleEmitter*                  emitter;
+
+    float                             angle;
+    float                             rotationSpeed;
+
+    Billboard*                        halo;
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+};
+
+#endif /* _LBOLT_H */
Index: trunk/src/world_entities/projectiles/mbolt.cc
===================================================================
--- trunk/src/world_entities/projectiles/mbolt.cc	(revision 10368)
+++ trunk/src/world_entities/projectiles/mbolt.cc	(revision 10368)
@@ -0,0 +1,226 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer
+   co-programmer: Benjamin Grauer
+
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "mbolt.h"
+
+#include "state.h"
+#include "model.h"
+
+#include "particles/dot_emitter.h"
+#include "particles/sprite_particles.h"
+
+#include "space_ships/space_ship.h"
+
+#include <cassert>
+#include "debug.h"
+
+#include "static_model.h"
+
+#include "effects/trail.h"
+
+
+
+ObjectListDefinition(MBolt);
+CREATE_FAST_FACTORY_STATIC(MBolt);
+
+/**
+ *  standard constructor
+*/
+MBolt::MBolt () : Projectile()
+{
+  this->registerObject(this, MBolt::_objectList);
+  this->loadModel("models/projectiles/mbolt.obj",4);
+
+
+  //this->loadModel("models/projectiles/laser.obj");
+
+  this->setMinEnergy(4);
+  this->setHealthMax(0);
+  this->lifeSpan = 1.5;
+  this->angle     = 0;
+
+  //this->emitter = new DotEmitter(1000, 0, 0);
+  this->emitter = new DotEmitter(50, 0, 0);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI,M_PI);
+  this->emitter->setInheritSpeed(this->velocity.len());
+  this->emitter->setEmissionRate(500.0);
+  this->emitter->setEmissionVelocity(this->velocity.len());
+
+  this->mat = new Material("mBolt");
+  //this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+  this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE);
+  this->mat->setDiffuse(1,1,1);
+  this->mat->setDiffuseMap("laser_add.png");
+  this->mat->setDiffuseMap("laser.png",1);
+
+  dynamic_cast<StaticModel*>(this->getModel())->addMaterial(*this->mat);
+  dynamic_cast<StaticModel*>(this->getModel())->finalize();
+
+  dynamic_cast<StaticModel*>(this->getModel())->rebuild();
+  //this->buildObbTree(4);
+
+  this->trail = new Trail(6, 4, .1, this);
+  //this->trail->setParent( this);
+  this->trail->setTexture( "maps/laser.png");
+  this->trail->setAbsCoor(this->getAbsCoor() - Vector(.7,0,0));
+
+}
+
+
+/**
+ *  standard deconstructor
+ *
+ */
+MBolt::~MBolt ()
+{
+
+  if (MBolt::explosionParticles != NULL && MBolt::objectList().size() <= 1)
+  {
+    if (ParticleSystem::objectList().exists(MBolt::explosionParticles))
+      delete MBolt::explosionParticles;
+    MBolt::explosionParticles = NULL;
+    PRINTF(1)("Deleting MBolt Explosion Particles\n");
+  }
+
+  delete this->emitter;
+  delete this->trail;
+}
+
+SpriteParticles* MBolt::explosionParticles = NULL;
+
+void MBolt::activate()
+{
+  this->origList = this->getOMListNumber();
+  this->toList(OM_ENVIRON);
+  if (unlikely(MBolt::explosionParticles == NULL))
+  {
+    MBolt::explosionParticles = new SpriteParticles(1000);
+    MBolt::explosionParticles->setName("MBoltExplosionParticles");
+    MBolt::explosionParticles->setLifeSpan(.2, .1);
+    MBolt::explosionParticles->setRadius(0.0, 10.0);
+    MBolt::explosionParticles->setRadius(.5, 6.0);
+    MBolt::explosionParticles->setRadius(1.0, 3.0);
+    MBolt::explosionParticles->setColor(0.0, 1,1,0,.9);
+    MBolt::explosionParticles->setColor(0.5, .8,.8,0,.5);
+    MBolt::explosionParticles->setColor(1.0, .8,.8,.7,.0);
+  }
+
+  this->setPhysDamage(10);
+  this->setElecDamage(0);
+  this->setHealth(0);
+
+  this->emitter->setSpread(0);
+  this->emitter->setEmissionRate(10.0);
+  this->emitter->setEmissionVelocity(50);
+}
+
+
+void MBolt::deactivate()
+{
+  assert (MBolt::explosionParticles != NULL);
+  MBolt::explosionParticles->removeEmitter(this->emitter);
+  this->lifeCycle = 0.0;
+
+  this->lifeCycle = 0.0;
+  this->toList(OM_NULL);
+  //this->toList(OM_DEAD);
+  this->removeNode();
+  MBolt::fastFactory->kill(this);
+}
+
+void MBolt::hit (float damage, WorldEntity* entity )
+{
+
+  if (this->hitEntity != entity)
+    this->destroy( entity );
+  this->hitEntity = entity;
+ // dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
+  //this->destroy(this);
+  this->deactivate();
+
+  return;
+
+}
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void MBolt::tick (float dt)
+{
+  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt))
+    this->deactivate();
+
+  this->angle += MBolt::rotationSpeed * dt;
+  this->trail->tick(dt);
+
+  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
+  {
+    if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
+    {
+      (*eIterator)->hit (this->getDamage(),this);
+      this->deactivate();
+      PRINTF(0)("MBolt destroyed\n");
+    }
+  }
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void MBolt::destroy (WorldEntity* killer)
+{
+  //this->deactivate();
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY MBolt\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+
+  this->emitter->setSystem(MBolt::explosionParticles);
+}
+
+
+void MBolt::draw () const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+
+  glPushMatrix();
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+
+  glScalef(0.75/4, 0.7/16, 0.7/16);  // no double rescale
+
+  this->mat->select();
+  dynamic_cast<StaticModel*>(this->getModel())->draw();
+  this->mat->unselect();
+  glScalef(4/.75,16/.7,16/.7);
+  glTranslatef(-3,0,0);
+  this->trail->draw();
+  glPopMatrix();
+  glPopAttrib();
+
+}
Index: trunk/src/world_entities/projectiles/mbolt.h
===================================================================
--- trunk/src/world_entities/projectiles/mbolt.h	(revision 10368)
+++ trunk/src/world_entities/projectiles/mbolt.h	(revision 10368)
@@ -0,0 +1,54 @@
+/*!
+ * @file mbolt.h
+ * @brief medium blaster bolt
+*/
+
+#ifndef _MBOLT_H
+#define _MBOLT_H
+
+#include "projectile.h"
+#include "material.h"
+
+class Vector;
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+class Trail;
+
+class MBolt : public Projectile
+{
+  ObjectListDeclaration(MBolt);
+  public:
+    MBolt ();
+    virtual ~MBolt ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void hit (float damage, WorldEntity* entity);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+  private:
+    static FastFactory*               fastFactory;
+    static SpriteParticles*           explosionParticles;
+
+    Trail*                            trail;
+
+    float                             angle;
+    static const float                rotationSpeed = 1080;
+
+    ParticleEmitter*                  emitter;
+
+    Material*                         mat;
+
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+};
+
+#endif /* _MBOLT_H */
Index: trunk/src/world_entities/projectiles/projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/projectile.cc	(revision 10351)
+++ trunk/src/world_entities/projectiles/projectile.cc	(revision 10368)
@@ -25,4 +25,6 @@
 #include "playable.h"
 
+#include <cmath>
+
 #include "debug.h"
 
@@ -46,4 +48,6 @@
   this->subscribeReaction( CoRe::CREngine::CR_PHYSICS_FULL_WALK, Playable::staticClassID());
 
+  this->physDamage = 0.0f;
+  this->elecDamage = 0.0f;
   //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
 }
@@ -60,4 +64,31 @@
   */
   //delete this->projectileModel;
+}
+
+Projectile::Projectile (float pDamage, float eDamage, PNode* target) : WorldEntity()
+{
+  this->registerObject(this, Projectile::_objectList);
+
+  this->lifeCycle = 0.0;
+  this->lifeSpan = 1.0f; /* sec */
+  this->removeNode();
+
+  /* character attributes */
+  this->setHealth(1.0f);
+  this->setDamage(1.0f); // default damage of a projectile set to 100.0 damage points
+
+  this->physDamage = pDamage;
+  this->elecDamage = eDamage;
+  this->target = target;
+
+  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+}
+
+void Projectile::initialize(float pDamage, float eDamage, PNode* target)
+{
+  /* character attributes*/
+  this->physDamage = pDamage;
+  this->elecDamage = eDamage;
+  this->target = target;
 }
 
@@ -124,4 +155,13 @@
 
 
+void Projectile::collidesWith (WorldEntity* target, const Vector& location)
+{
+  dynamic_cast<SpaceShip*>(target)->damage(this->getPhysDamage(),this->getElecDamage());
+//   this->destroy(NULL);
+  this->destroy(target);
+}
+
+
+
 /**
  * signal tick, time dependent things will be handled here
@@ -130,7 +170,4 @@
 void Projectile::tick (float dt)
 {
-  Vector v = this->velocity * (dt);
-  this->shiftCoor(v);
-
   if (this->tickLifeCycle(dt))
     this->destroy( NULL );
Index: trunk/src/world_entities/projectiles/projectile.h
===================================================================
--- trunk/src/world_entities/projectiles/projectile.h	(revision 10351)
+++ trunk/src/world_entities/projectiles/projectile.h	(revision 10368)
@@ -12,4 +12,5 @@
 #include "world_entity.h"
 #include "loading/fast_factory.h"
+#include "space_ships/space_ship.h"
 
 #include "sound_source.h"
@@ -22,4 +23,9 @@
     Projectile ();
     virtual ~Projectile ();
+
+    /** @brief Constructor with variable passing*/
+    Projectile (float pDamage, float eDamage, PNode* target);
+    /** @brief for void construction; setting values later - needed for FastFactory*/
+    virtual void initialize(float pDamage, float eDamage, PNode* target);
 
     void setFlightDirection(const Quaternion& flightDirection);
@@ -44,4 +50,7 @@
     virtual void destroy (WorldEntity* killer);
 
+    virtual void collidesWith (WorldEntity* target, const Vector& location);  //!< collision handler; used against SpaceShip as most target will be
+
+
     virtual void tick (float dt);
     /** @brief convenience function
@@ -50,18 +59,28 @@
     inline bool tickLifeCycle(float dt ) { this->lifeCycle += dt/this->lifeSpan;  return(unlikely(this->lifeCycle >= 1)); }
 
+    inline float getPhysDamage() { return this->physDamage; };
+    inline float getElecDamage() { return this->elecDamage; };
+
+    inline void setPhysDamage( float dmg) {this->physDamage = dmg; };
+    inline void setElecDamage( float dmg) {this->elecDamage = dmg; };
 
   protected:
     // energy
-    float                  energyMin;                 //!< The minimal Energy a Projectile needs to be emitted.
-    bool                   bChargeable;               //!< if the Projectile is Charegeable
+    int		       origList;			//!< FIXME currently a fix around the collision seg fault
+    float                   energyMin;                //!< The minimal Energy a Projectile needs to be emitted.
+    bool                    bChargeable;              //!< if the Projectile is Charegeable
 
-    float                  lifeCycle;                 //!< The percentage of the Lifetime done [0-1]
-    float                  lifeSpan;                  //!< The entire lifespan of the Shoot. in seconds
+    float                   lifeCycle;                //!< The percentage of the Lifetime done [0-1]
+    float                   lifeSpan;                 //!< The entire lifespan of the Shoot. in seconds
 
-    Vector                 flightDirection;           //!< DOF direction in which the shoot flighs
+    float                   physDamage;               //!< damage to shield and armor
+    float                   elecDamage;               //!< damage to elctronic
+    float                   turningSpeed;             //!< degrees per tick
 
-    Vector                 velocity;                  //!< velocity of the projectile.
+    Vector                  flightDirection;          //!< DOF direction in which the shoot flighs
 
-    PNode*                 target;                    //!< A target for guided Weapons.
+    Vector                  velocity;                 //!< velocity of the projectile.
+
+    PNode*                  target;                   //!< A target for guided Weapons.
 
     OrxSound::SoundSource  soundSource;
Index: trunk/src/world_entities/projectiles/projectile_weapon.cc
===================================================================
--- trunk/src/world_entities/projectiles/projectile_weapon.cc	(revision 10368)
+++ trunk/src/world_entities/projectiles/projectile_weapon.cc	(revision 10368)
@@ -0,0 +1,182 @@
+
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Nicolas Schlumberger
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "projectile_weapon.h"
+
+#include "world_entity.h"
+#include "world_entities/weapons/weapon.h"
+#include "model.h"
+#include "sound/resource_sound_buffer.h"
+
+#include <cmath>
+
+#include "debug.h"
+
+ObjectListDefinition(ProjectileWeapon);
+
+/**
+ *  standard constructor
+*/
+ProjectileWeapon::ProjectileWeapon () : Projectile()
+{
+  this->registerObject(this, ProjectileWeapon::_objectList);
+
+  this->lifeCycle = 0.0;
+  this->lifeSpan = 1.0f; /* sec */
+  this->target = NULL;
+  this->removeNode();
+
+  /* character attributes */
+  this->setHealth(1.0f);
+  this->setDamage(1.0f); // default damage of a projectile_weapon set to 100.0 damage points
+
+  this->physDamage = 0.0f;
+  this->elecDamage = 0.0f;
+  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+}
+
+
+/**
+ *  standard deconstructor
+*/
+ProjectileWeapon::~ProjectileWeapon ()
+{
+}
+
+ProjectileWeapon::ProjectileWeapon (float pDamage, float eDamage, PNode* target) : Projectile()
+{
+  this->registerObject(this, ProjectileWeapon::_objectList);
+
+  this->lifeCycle = 0.0;
+  this->lifeSpan = 1.0f; /* sec */
+  this->removeNode();
+
+  /* character attributes */
+  this->setHealth(1.0f);
+  this->setDamage(1.0f); // default damage of a projectile_weapon set to 100.0 damage points
+
+  this->physDamage = pDamage;
+  this->elecDamage = eDamage;
+  this->target = target;
+
+  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+}
+
+void ProjectileWeapon::initialize(float pDamage, float eDamage, PNode* target)
+{
+  /* character attributes*/
+  this->physDamage = pDamage;
+  this->elecDamage = eDamage;
+  this->target = target;
+}
+
+
+void ProjectileWeapon::loadExplosionSound(const std::string& explosionSound)
+{
+  if (!explosionSound.empty())
+    this->explosionBuffer = OrxSound::ResourceSoundBuffer(explosionSound);
+  else
+    this->explosionBuffer = OrxSound::SoundBuffer();
+}
+
+
+void ProjectileWeapon::loadEngineSound(const std::string& engineSound)
+{
+  if (!engineSound.empty())
+    this->engineBuffer = OrxSound::ResourceSoundBuffer(engineSound);
+  else
+    this->engineBuffer = OrxSound::SoundBuffer();
+}
+
+
+void ProjectileWeapon::setMinEnergy(float energyMin)
+{
+  this->energyMin = energyMin;
+}
+
+
+/**
+ *  this sets the flight direction of the projectile_weapon
+ * @param directin in which to flight
+
+   this function will calculate a vector out of this to be used in the
+   tick function
+*/
+void ProjectileWeapon::setFlightDirection(const Quaternion& flightDirection)
+{
+  Vector v(1, 0, 0);
+  this->flightDirection = flightDirection.apply(v);
+  this->flightDirection.normalize();
+}
+
+/**
+ *  sets the velocity vector to a spec speed
+ * @param velocity: vector of the velocity
+*/
+void ProjectileWeapon::setVelocity(const Vector &velocity)
+{
+  //Vector offsetVel =
+  this->velocity = velocity;
+  // offsetVel.normalize();
+  //this->velocity += (offsetVel * 50.0);
+}
+
+
+
+void ProjectileWeapon::setTarget(PNode* target)
+{
+  if (this->target == NULL)
+    this->target = new PNode(target, PNODE_REPARENT_ON_PARENTS_REMOVE | PNODE_REPARENT_TO_NULL | PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  else
+    this->target->setParent(target);
+}
+
+
+void ProjectileWeapon::collidesWith (WorldEntity* target, const Vector& location)
+{
+  dynamic_cast<SpaceShip*>(target)->damage(this->getPhysDamage(),this->getElecDamage());
+//   this->destroy(NULL);
+  this->destroy(target);
+}
+
+
+
+/**
+ * signal tick, time dependent things will be handled here
+ * @param dt since last tick
+*/
+void ProjectileWeapon::tick (float dt)
+{
+  if (this->tickLifeCycle(dt))
+    this->destroy( NULL );
+}
+
+
+/**
+ *  the function gets called, when the projectile_weapon is destroyed
+*/
+void ProjectileWeapon::destroy (WorldEntity* killer)
+{
+  if (this->explosionBuffer.loaded())
+    this->soundSource.play(this->explosionBuffer);
+}
+
+void ProjectileWeapon::blow()
+{
+}
+
Index: trunk/src/world_entities/projectiles/projectile_weapon.h
===================================================================
--- trunk/src/world_entities/projectiles/projectile_weapon.h	(revision 10368)
+++ trunk/src/world_entities/projectiles/projectile_weapon.h	(revision 10368)
@@ -0,0 +1,126 @@
+/*!
+ * @file projectile_weapon.h
+ * a projectile_weapon, that is been shooted by a weapon
+ *
+ * You can use this class to make some ProjectileWeapons/Bullets/Lasers/Rockets/etc.
+ *
+ */
+
+#ifndef _PROJECTILE_WEAPON_H
+#define _PROJECTILE_WEAPON_H
+
+#include "world_entity.h"
+#include "loading/fast_factory.h"
+#include "space_ships/space_ship.h"
+
+#include "loading/fast_factory.h"
+#include "world_entities/projectiles/projectile.h"
+#include "weapons/weapon.h"
+
+
+#include "sound_source.h"
+#include "sound_buffer.h"
+
+class FastFactory;
+
+
+class ProjectileWeapon : public Projectile
+{
+  ObjectListDeclaration(ProjectileWeapon);
+  public:
+    ProjectileWeapon ();
+    virtual ~ProjectileWeapon ();
+
+    /** @brief Constructor with variable passing*/
+    ProjectileWeapon (float pDamage, float eDamage, PNode* target);
+    /** @brief for void construction; setting values later - needed for FastFactory*/
+    virtual void initialize(float pDamage, float eDamage, PNode* target);
+
+    void setFlightDirection(const Quaternion& flightDirection);
+    void setVelocity(const Vector &velocity);
+    void setLifeSpan(float lifeSpan);
+
+    void loadExplosionSound(const std::string& explosionSound);
+    void loadEngineSound(const std::string& engineSound);
+    void setMinEnergy(float energyMin);
+    /** @returns the minimal charched energy */
+    inline float getMinEnergy() { return this->energyMin; };
+    /** @returns if the ProjectileWeapon can be charged */
+    inline bool isChageable() { return this->bChargeable; };
+
+    void setTarget(PNode* target);
+
+    /** @brief This is called, when the ProjectileWeapon is Emitted */
+    virtual void activate() = 0;
+    /** @brief This is called, when the ProjectileWeapon is being destroyed, or deleted */
+    virtual void deactivate() = 0;
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void collidesWith (WorldEntity* target, const Vector& location);  //!< collision handler; used against SpaceShip as most target will be
+
+
+    virtual void tick (float dt);
+    /** @brief convenience function
+     * @param dt the Time passed
+     * @returns true if the ProjectileWeapon is past its lifeTime, false if it shall still live */
+    inline bool tickLifeCycle(float dt ) { this->lifeCycle += dt/this->lifeSpan;  return(unlikely(this->lifeCycle >= 1)); }
+
+    inline float getPhysDamage() { return this->physDamage; };
+    inline float getElecDamage() { return this->elecDamage; };
+
+    inline void setPhysDamage( float dmg) {this->physDamage = dmg; };
+    inline void setElecDamage( float dmg) {this->elecDamage = dmg; };
+
+    inline void setRotationAxis ( Vector axis ) { this->rotationAxis = axis; };
+    inline void setRotationSpeed ( float speed ) { this->rotationSpeed = speed; };
+    inline const Vector & getRotationAxis () const { return this->rotationAxis; };
+    inline float getRotationSpeed () { return this->rotationSpeed; };     //!< Added for completeness
+
+    inline void setAngle () { this->angle = 0; };
+    inline void setAngle ( float angle ) { this->angle = angle; };
+    inline float getAngle () { return this->angle; };
+
+    inline void updateAngle ( float dt ) { this->angle += this->rotationSpeed * dt; };
+
+    inline void setFragments( int frag ) { this->fragments = frag; };
+    inline int getFragments () { return this->fragments; };
+
+//     virtual void blow ();
+
+  protected:
+    // energy
+    float                   energyMin;                //!< The minimal Energy a ProjectileWeapon needs to be emitted.
+    bool                    bChargeable;              //!< if the ProjectileWeapon is Charegeable
+
+    float                   lifeCycle;                //!< The percentage of the Lifetime done [0-1]
+    float                   lifeSpan;                 //!< The entire lifespan of the Shoot. in seconds
+
+    float                   physDamage;               //!< damage to shield and armor
+    float                   elecDamage;               //!< damage to elctronic
+    float                   turningSpeed;             //!< degrees per tick
+
+    Vector                  flightDirection;          //!< DOF direction in which the shoot flighs
+
+    float                   angle;                    //!< Spinning Projectile, needed to ajust dispersal pattern
+    float                   rotationSpeed;            //!< rotation speed
+    Vector                  rotationAxis;           //!< rotation axis
+
+    int                     fragments;                //!< Number of fragements created by the blow
+
+    Vector                  velocity;                 //!< velocity of the projectile_weapon.
+
+    PNode*                  target;                   //!< A target for guided Weapons.
+
+    virtual void            blow();
+
+//     FastFactory             ff;
+//     static FastFactory*               fastFactory;
+
+    OrxSound::SoundSource  soundSource;
+  private:
+    OrxSound::SoundBuffer  explosionBuffer;
+    OrxSound::SoundBuffer  engineBuffer;
+};
+
+#endif /* _PROJECTILE_WEAPON_H */
Index: trunk/src/world_entities/projectiles/spike.cc
===================================================================
--- trunk/src/world_entities/projectiles/spike.cc	(revision 10368)
+++ trunk/src/world_entities/projectiles/spike.cc	(revision 10368)
@@ -0,0 +1,175 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Nicolas Schlumberger, Marc Schaerrer
+   co-programmer: Benjamin Grauer
+
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "spike.h"
+
+#include "state.h"
+#include "model.h"
+
+#include "particles/dot_emitter.h"
+#include "particles/sprite_particles.h"
+
+#include <cassert>
+#include "debug.h"
+
+#include "space_ships/space_ship.h"
+
+
+
+ObjectListDefinition(Spike);
+CREATE_FAST_FACTORY_STATIC(Spike);
+
+/**
+ *  standard constructor
+*/
+Spike::Spike () : Projectile()
+{
+  this->registerObject(this, Spike::_objectList);
+
+  this->loadModel("models/projectiles/spike.obj", 2);
+
+  this->setMinEnergy(1);
+  this->setHealthMax(0);
+  this->lifeSpan = 2.0;
+
+  this->emitter = new DotEmitter(100, 5, M_2_PI);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+  this->emitter->setEmissionRate(300.0);
+  this->emitter->setEmissionVelocity(50.0);
+
+  this->angle = 0;
+  this->rotationSpeed = 130;
+}
+
+
+/**
+ *  standard deconstructor
+*/
+Spike::~Spike ()
+{
+  // delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (Spike::explosionParticles != NULL && Spike::objectList().size() <= 1)
+  {
+    //if (ClassList::exists(Spike::explosionParticles, CL_PARTICLE_SYSTEM))
+    //  delete Spike::explosionParticles;
+    PRINTF(1)("Deleting Spike Particles\n");
+/*
+  if (Spike::objectList().exists(Spike::explosionParticles))
+      delete Spike::explosionParticles; */
+    Spike::explosionParticles = NULL;
+  }
+
+}
+
+SpriteParticles* Spike::explosionParticles = NULL;
+
+void Spike::activate()
+{
+  if (unlikely(Spike::explosionParticles == NULL))
+  {
+    Spike::explosionParticles = new SpriteParticles(1000);
+    Spike::explosionParticles->setName("SpikeExplosionParticles");
+    Spike::explosionParticles->setLifeSpan(.5, .3);
+    Spike::explosionParticles->setRadius(0.0, 10.0);
+    Spike::explosionParticles->setRadius(.5, 6.0);
+    Spike::explosionParticles->setRadius(1.0, 3.0);
+    Spike::explosionParticles->setColor(0.0, 1,1,0,.9);
+    Spike::explosionParticles->setColor(0.5, .8,.8,0,.5);
+    Spike::explosionParticles->setColor(1.0, .8,.8,.7,.0);
+  }
+
+  this->setDamage(5);
+  this->setHealth(0);
+}
+
+
+void Spike::deactivate()
+{
+  assert (Spike::explosionParticles != NULL);
+  //Spike::explosionParticles->removeEmitter(this->emitter);
+  this->emitter->setSystem(NULL);
+  this->lifeCycle = 0.0;
+
+  this->toList(OM_NULL);
+  this->removeNode();
+  Spike::fastFactory->kill(this);
+}
+
+/*
+void Spike::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  PRINTF(0)("Collision with Spike\n");
+  if (this->hitEntity != entity && entity->isA(CL_NPC))
+    this->destroy( entity );
+  this->hitEntity = entity;
+  dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0);
+//   this->deactivate();
+}*/
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void Spike::tick (float dt)
+{
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt))
+    this->deactivate();
+
+  angle += rotationSpeed * dt;
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void Spike::destroy (WorldEntity* killer)
+{
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY Spike\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+
+  this->emitter->setSystem(Spike::explosionParticles);
+}
+
+
+void Spike::draw () const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+  glRotatef(angle, 1.0, 0.0, 0.0);
+
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  this->getModel()->draw();
+
+  glPopMatrix();
+  glPopAttrib();
+}
+
Index: trunk/src/world_entities/projectiles/spike.h
===================================================================
--- trunk/src/world_entities/projectiles/spike.h	(revision 10368)
+++ trunk/src/world_entities/projectiles/spike.h	(revision 10368)
@@ -0,0 +1,52 @@
+/*!
+ * @file spike.h
+ * @brief light blaster spike
+*/
+
+#ifndef _SPIKE_H
+#define _SPIKE_H
+
+#include "projectile.h"
+#include "effects/billboard.h"
+
+class Vector;
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+
+class Spike : public Projectile
+{
+  ObjectListDeclaration(Spike);
+  public:
+    Spike ();
+    virtual ~Spike ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+   //virtual void collidesWith(WorldEntity* entity, const Vector& location);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+    inline void setVelocity(Vector velocity) {this->velocity = velocity;}
+  private:
+    static FastFactory*               fastFactory;
+
+    static SpriteParticles*           explosionParticles;
+
+    ParticleEmitter*                  emitter;
+
+    float                             angle;
+    float                             rotationSpeed;
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+
+    Vector                            velocity;
+};
+
+#endif /* _SPIKE_H */
Index: trunk/src/world_entities/projectiles/spike_ball.cc
===================================================================
--- trunk/src/world_entities/projectiles/spike_ball.cc	(revision 10368)
+++ trunk/src/world_entities/projectiles/spike_ball.cc	(revision 10368)
@@ -0,0 +1,277 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Nicolas Schlumberger, Marc Schaerrer
+   co-programmer: Benjamin Grauer
+
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "spike_ball.h"
+
+#include "state.h"
+#include "model.h"
+
+#include "particles/dot_emitter.h"
+#include "particles/sprite_particles.h"
+
+#include <cassert>
+#include "debug.h"
+
+#include "space_ships/space_ship.h"
+
+
+
+ObjectListDefinition(SpikeBall);
+CREATE_FAST_FACTORY_STATIC(SpikeBall);
+
+/**
+ *  standard constructor
+*/
+SpikeBall::SpikeBall () : ProjectileWeapon()
+{
+  this->registerObject(this, SpikeBall::_objectList);
+
+  this->loadModel("models/projectiles/spike_ball.obj", .25);
+
+  this->setMinEnergy(1);
+  this->setHealthMax(1);
+  this->lifeSpan = 1.0;
+
+  this->emitter = new DotEmitter(100, 5, M_2_PI);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+  this->emitter->setEmissionRate(300.0);
+  this->emitter->setEmissionVelocity(50.0);
+
+  this->setRotationSpeed(130);
+
+  this->halo = new Billboard();
+  this->halo->setSize(2, 2);
+  this->halo->setTexture("hbolt_halo.png");
+
+  this->setFragments(26);
+
+  this->size = 4;
+
+  this->launcher = new Vector [this->getFragments()];
+}
+
+
+/**
+ *  standard deconstructor
+*/
+SpikeBall::~SpikeBall ()
+{
+  // delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (SpikeBall::explosionParticles != NULL && SpikeBall::objectList().size() <= 1)
+  {
+    //if (ClassList::exists(SpikeBall::explosionParticles, CL_PARTICLE_SYSTEM))
+    //  delete SpikeBall::explosionParticles;
+    PRINTF(1)("Deleting SpikeBall Particles\n");
+//    if (SpikeBall::objectList().exists(SpikeBall::explosionParticles))
+//      delete SpikeBall::explosionParticles;
+    SpikeBall::explosionParticles = NULL;
+  }
+
+}
+
+SpriteParticles* SpikeBall::explosionParticles = NULL;
+
+void SpikeBall::activate()
+{
+  if (unlikely(SpikeBall::explosionParticles == NULL))
+  {
+    SpikeBall::explosionParticles = new SpriteParticles(1000);
+    SpikeBall::explosionParticles->setName("SpikeBallExplosionParticles");
+    SpikeBall::explosionParticles->setLifeSpan(.5, .3);
+    SpikeBall::explosionParticles->setRadius(0.0, 10.0);
+    SpikeBall::explosionParticles->setRadius(.5, 6.0);
+    SpikeBall::explosionParticles->setRadius(1.0, 3.0);
+    SpikeBall::explosionParticles->setColor(0.0, 1,1,0,.9);
+    SpikeBall::explosionParticles->setColor(0.5, .8,.8,0,.5);
+    SpikeBall::explosionParticles->setColor(1.0, .8,.8,.7,.0);
+  }
+  this->setDamage(5);
+  this->setHealth(10);
+  this->setRotationAxis(VECTOR_RAND(1));
+  this->setAngle();
+
+  this->launcher[0] = Vector(1.0, 0.0, 0.0);
+  this->launcher[1] = Vector(0.0, 1.0, 0.0);
+  this->launcher[2] = Vector(0.0, 0.0, 1.0);
+
+  this->launcher[3] = Vector(1.0, 1.0, 0.0);
+  this->launcher[4] = Vector(0.0, 1.0, 1.0);
+  this->launcher[5] = Vector(1.0, 0.0, 1.0);
+  this->launcher[6] = Vector(1.0, -1.0, 0.0);
+  this->launcher[7] = Vector(0.0, 1.0, -1.0);
+  this->launcher[8] = Vector(-1.0, 0.0, 1.0);
+
+  this->launcher[9] = Vector(-1.0, 1.0, 1.0);
+  this->launcher[10] = Vector(1.0, 1.0, 1.0);
+  this->launcher[11] = Vector(1.0, -1.0, 1.0);
+  this->launcher[12] = Vector(-1.0, -1.0, 1.0);
+
+  int tmp = this->getFragments() / 2;
+  for (int i = 0; i < tmp; i++)
+  {
+    this->launcher[i].normalize();
+    this->launcher[tmp + i] =  this->launcher[i] * (-1);
+  }
+
+  this->freeMode = false;
+}
+
+
+void SpikeBall::deactivate()
+{
+  assert (SpikeBall::explosionParticles != NULL);
+  //SpikeBall::explosionParticles->removeEmitter(this->emitter);
+  this->emitter->setSystem(NULL);
+  this->lifeCycle = 0.0;
+
+  this->toList(OM_NULL);
+  this->removeNode();
+  SpikeBall::fastFactory->kill(this);
+}
+
+/*
+void SpikeBall::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  PRINTF(0)("Collision with SpikeBall\n");
+  if (this->hitEntity != entity && entity->isA(CL_NPC))
+    this->destroy( entity );
+  this->hitEntity = entity;
+  dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0);
+}*/
+
+
+void SpikeBall::blow()
+{
+  if ( this->freeMode )
+    updateFireDir();
+
+  Spike* pj = NULL;
+  for ( int i = 0; i < this->getFragments(); i++)
+  {
+    pj  = new Spike();
+    assert( pj );
+    pj->setParent(PNode::getNullParent());
+
+    pj->setVelocity(this->launcher[i].getNormalized() * 250.0);
+
+    pj->setParent(PNode::getNullParent());
+    pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size);
+//     Quaternion q;
+    pj->setAbsDir(Quaternion(this->launcher[i], 0));
+
+    pj->toList(this->getOMListNumber());
+
+    pj->activate();
+  }
+}
+
+
+void SpikeBall::updateFireDir(){
+
+  float** m = new float* [3];
+  for( int i = 0; i < 3 ; i++)
+    m[i] = new float;
+
+  float nx, ny, nz, ca, sa;
+
+  nx = this->getRotationAxis().x;
+  ny = this->getRotationAxis().y;
+  nz = this->getRotationAxis().z;
+
+  ca = cos (this->getAngle());
+  sa = sin (this->getAngle());
+
+  m[0][0] = nx * nx * (1 - ca) + ca;
+  m[0][1] = nx * ny * (1 - ca) + nz * sa;
+  m[0][2] = nx * nz * (1 - ca) - ny * sa;
+  m[1][0] = nx * nz * (1 - ca) - nz * sa;
+  m[1][1] = ny * ny * (1 - ca) + ca;
+  m[1][2] = ny * nz * (1 - ca) + nx * sa;
+  m[2][0] = nx * nz * (1 - ca) + ny * sa;
+  m[2][1] = ny * nz * (1 - ca) - nx * sa;
+  m[2][2] = nz * nz * (1 - ca) + ca;
+
+  float x, y, z;
+  for (int i = 0; i < this->getFragments(); i++){
+    x = m[0][0] * this->launcher[i].x + m[0][1] * this->launcher[i].y + m[0][2] * this->launcher[i].z;
+    y = m[1][0] * this->launcher[i].x + m[1][1] * this->launcher[i].y + m[1][2] * this->launcher[i].z;
+    z = m[2][0] * this->launcher[i].x + m[2][1] * this->launcher[i].y + m[2][2] * this->launcher[i].z;
+
+    this->launcher[i] = Vector (x, y, z);
+  }
+
+  for( int i = 0; i < 3 ; i++)
+    delete m[i];
+  delete m;
+}
+
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void SpikeBall::tick (float dt)
+{
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt)){
+    this->blow();
+    this->deactivate();
+  }
+
+  this->updateAngle( dt );
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void SpikeBall::destroy (WorldEntity* killer)
+{
+  ProjectileWeapon::destroy( killer );
+  PRINTF(5)("DESTROY SpikeBall\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+
+  this->emitter->setSystem(SpikeBall::explosionParticles);
+}
+
+
+void SpikeBall::draw () const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  this->halo->draw();
+
+  glRotatef(angle, this->getRotationAxis().x, this->getRotationAxis().y, this->getRotationAxis().z);
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  this->getModel()->draw();
+
+
+  glPopMatrix();
+  glPopAttrib();
+}
+
Index: trunk/src/world_entities/projectiles/spike_ball.h
===================================================================
--- trunk/src/world_entities/projectiles/spike_ball.h	(revision 10368)
+++ trunk/src/world_entities/projectiles/spike_ball.h	(revision 10368)
@@ -0,0 +1,67 @@
+/*!
+ * @file spike_ball.h
+ * @brief Noxonian SpikeBall Projectile; 2 stage weapon, splits into spikes
+*/
+
+#ifndef _SPIKE_BALL_H
+#define _SPIKE_BALL_H
+
+#include "projectile_weapon.h"
+#include "spike.h"
+#include "effects/billboard.h"
+
+
+#include "extendable.h"
+
+class Vector;
+class ProjectileWeapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+
+
+class SpikeBall : public ProjectileWeapon
+{
+  ObjectListDeclaration(SpikeBall);
+  public:
+    SpikeBall ();
+    virtual ~SpikeBall ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+   // virtual void collidesWith(WorldEntity* entity, const Vector& location);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+    inline void setVelocity(Vector velocity) { this->velocity = velocity; }
+
+
+  private:
+    static FastFactory*               fastFactory;
+
+    static SpriteParticles*           explosionParticles;
+
+    ParticleEmitter*                  emitter;
+
+    Vector                            velocity;
+
+    Billboard*                        halo;
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+
+    void updateFireDir();
+    virtual void blow();
+
+    Vector*       launcher;
+    float         size;
+
+    bool          freeMode;
+
+};
+
+#endif /* _SPIKE_BALL_H */
Index: trunk/src/world_entities/projectiles/swarm_projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/swarm_projectile.cc	(revision 10368)
+++ trunk/src/world_entities/projectiles/swarm_projectile.cc	(revision 10368)
@@ -0,0 +1,273 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer, Nicolas Schlumberger
+   co-programmer:
+
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "swarm_projectile.h"
+
+#include "state.h"
+
+#include "particles/dot_emitter.h"
+#include "particles/sprite_particles.h"
+#include "space_ships/space_ship.h"
+#include "effects/trail.h"
+
+#include "debug.h"
+
+
+
+#include "math/vector.h"
+
+ObjectListDefinition(SwarmProjectile);
+CREATE_FAST_FACTORY_STATIC(SwarmProjectile);
+
+/**
+ *  standard constructor
+*/
+SwarmProjectile::SwarmProjectile () : Projectile()
+{
+
+/*  this->loadModel("models/projectiles/orx-rocket.obj", 0.5);*/
+  this->loadModel("models/projectiles/swarm_projectile.obj"); // no double rescale (see draw())
+  this->loadExplosionSound("sound/explosions/explosion_4.wav");
+
+
+  this->setMinEnergy(1);
+  this->setHealthMax(10);
+  this->lifeSpan = 4.0;
+  this->agility = 3.5;
+
+  this->emitter = new DotEmitter(100, 5, M_2_PI);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+
+  this->turningSpeed = 10;
+
+  this->physDamage = 200;
+  this->elecDamage = 0;
+
+  this->trail = new Trail(2.5,4,.2, this);
+  //this->trail->setParent( this);
+  this->trail->setTexture( "maps/laser.png");
+
+
+  this->origList = this->getOMListNumber();
+  this->toList(OM_ENVIRON);
+}
+
+
+/**
+ *  standard deconstructor
+*/
+SwarmProjectile::~SwarmProjectile ()
+{
+
+  if (SwarmProjectile::explosionParticles != NULL && SwarmProjectile::objectList().size() <= 1)
+  {
+    if (ParticleSystem::objectList().exists(SwarmProjectile::explosionParticles))
+      delete SwarmProjectile::explosionParticles;
+    SwarmProjectile::explosionParticles = NULL;
+  }
+  // delete this->emitter;
+  delete this->trail;
+}
+
+SpriteParticles* SwarmProjectile::explosionParticles = NULL;
+
+
+
+void SwarmProjectile::activate()
+{
+  this->toList(OM_ENVIRON);
+  if (unlikely(SwarmProjectile::explosionParticles == NULL))
+  {
+    SwarmProjectile::explosionParticles = new SpriteParticles(200);
+    SwarmProjectile::explosionParticles->setName("SwarmProjectileExplosionParticles");
+    SwarmProjectile::explosionParticles->setMaterialTexture("maps/radial-trans-noise.png");
+    SwarmProjectile::explosionParticles->setLifeSpan(.5, .3);
+    SwarmProjectile::explosionParticles->setRadius(0.0, 10);
+    SwarmProjectile::explosionParticles->setRadius(.5, 15.0);
+    SwarmProjectile::explosionParticles->setRadius(1.0, 10.0);
+    SwarmProjectile::explosionParticles->setColor(0.0, 0,1,0,1);
+    SwarmProjectile::explosionParticles->setColor(0.5, .8,.8,0,.8);
+    SwarmProjectile::explosionParticles->setColor(0.8, .8,.8,.3,.8);
+    SwarmProjectile::explosionParticles->setColor(1.0, 1,1,1,.0);
+  }
+
+  this->emitter->setEmissionRate(50.0);
+  this->emitter->setEmissionVelocity(0.0);
+  this->emitter->setInheritSpeed(0);
+
+  this->setHealth(10.0* (float)rand()/(float)RAND_MAX);
+
+  this->maxVelocity = 300;
+
+  this->rotationSpeed = 360;
+  this->angle = 0;
+
+  this->curDir = this->lastDir = this->velocity;
+}
+
+
+void SwarmProjectile::deactivate()
+{
+  this->emitter->setSystem(NULL);
+  this->lifeCycle = 0.0;
+
+  this->toList(OM_DEAD);
+  this->removeNode();
+  SwarmProjectile::fastFactory->kill(this);
+}
+
+
+void SwarmProjectile::hit (WorldEntity* entity, float damage)
+{
+  if (this->hitEntity != entity)
+    this->destroy( entity );
+  this->hitEntity = entity;
+  //dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
+ // this->destroy(this);
+  this->deactivate();
+}
+
+
+void SwarmProjectile::setTarget(PNode* target)
+{
+    this->target = target;
+}
+
+
+
+/**
+ *  this function gets called by tick to calculate the new flight direction
+ *  @param curDirection direction vector
+ *  @param estTargetDir target vector, pointing to where the target will be on hit
+ *  @param angle = tick * turningSpeed
+ *  @return (new) direction vector
+*/
+Vector SwarmProjectile::newDirection(Vector curDirection, Vector estTargetDir, float angle)
+{
+  if (unlikely(curDirection.len() == 0))
+    return curDirection;
+  //printf("recalculating direction\n");
+  float tmp = angleRad ( curDirection, estTargetDir);
+  if ( unlikely(tmp == 0) ) { return curDirection * maxVelocity / curDirection.len(); }
+//   printf("turning angle: %f\ntemp: %f\n", angle, tmp);
+
+  if( fabsf(angle) >  fabsf(tmp) )
+    angle = tmp;
+  else
+    angle *= tmp/fabsf(tmp);
+
+  Vector d = curDirection.cross(estTargetDir).cross(curDirection);
+  d.normalize();
+  if( unlikely( fabsf(angle) == 90)) { return d; } //avoid complication
+
+  Vector newDir = curDirection + d *  curDirection.len() * tan (angle);
+  newDir.normalize();
+  newDir *= curDirection.len();
+  return newDir;
+}
+
+
+
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param time since last tick
+*/
+void SwarmProjectile::tick (float time)
+{
+  if(unlikely(this->target == NULL)) /** Check whether the target still exists*/
+    this->deactivate();
+
+
+
+/** old  guiding function*/
+
+  float projectileVelocity = this->getVelocity().len();
+  if (target != NULL){
+    Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized();
+    this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time );
+  }
+  else
+    if (likely(projectileVelocity != 0 || projectileVelocity != this->maxVelocity) )
+      this->velocity *= (this->maxVelocity / projectileVelocity); // set speed to max
+/*
+  printf("position: %f, %f, %f\n", this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z);
+  printf("target position: %f, %f, %f\n", this->target->getAbsCoor().x, this->target->getAbsCoor().y, this->target->getAbsCoor().z);*/
+
+  this->shiftCoor(this->velocity * time);
+
+  if(this->tickLifeCycle(time))
+    this->deactivate();
+
+  this->trail->tick(time);
+
+  this->angle += this->rotationSpeed * time;
+  while (this->angle > 360)
+    this->angle -= 360;
+
+  this->lastDir = this->curDir;
+  this->curDir = this->velocity;
+
+  if( this->target != NULL && (this->getAbsCoor() - this->target->getAbsCoor()).len() < 3)   // FIXME  Temp fake workaround for collision :)
+  {
+    dynamic_cast<WorldEntity*>(target)->hit(this->getDamage(), this);
+    this->deactivate();
+  }
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+ */
+void SwarmProjectile::destroy (WorldEntity* killer)
+{
+
+//   printf("THIS SHOULD WORK!\n");
+
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY SwarmProjectile\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+  this->emitter->setSystem(SwarmProjectile::explosionParticles);
+
+  this->emitter->setEmissionRate(1000.0);
+  this->emitter->setEmissionVelocity(50.0);
+  this->deactivate();
+
+}
+
+
+void SwarmProjectile::draw () const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  Vector tmpDir = this->curDir; // *.7 + this->lastDir * .3;
+  tmpDir.slerpTo(this->lastDir, .4);
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  Vector tmpRot = this->getAbsCoor().cross(tmpDir);
+  glRotatef (angleRad ( this->getAbsCoor(), tmpDir), tmpRot.x, tmpRot.y, tmpRot.z );
+  glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  //glScalef(2.0, 2.0, 2.0);  // no double rescale
+  this->getModel()->draw();
+  glTranslatef(-.9,0,0);
+  this->trail->draw();
+  glPopMatrix();
+}
Index: trunk/src/world_entities/projectiles/swarm_projectile.h
===================================================================
--- trunk/src/world_entities/projectiles/swarm_projectile.h	(revision 10368)
+++ trunk/src/world_entities/projectiles/swarm_projectile.h	(revision 10368)
@@ -0,0 +1,63 @@
+/*!
+ * @file swarm_projectile.h
+ * @brief a SwarmProjectile Projectile
+*/
+
+#ifndef _SWARM_PROJECTILE_H
+#define _SWARM_PROJECTILE_H
+
+#include "projectile.h"
+
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+class Aim;
+class Trail;
+
+class SwarmProjectile : public Projectile
+{
+  ObjectListDeclaration(SwarmProjectile);
+  public:
+    SwarmProjectile ();
+    virtual ~SwarmProjectile ();
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void hit (WorldEntity* entity, float damage);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float time);
+    virtual void draw () const;
+
+    void setTarget(PNode* target);
+
+  private:
+    static FastFactory*               fastFactory;
+    static SpriteParticles*           explosionParticles;
+
+    Trail*                            trail;
+
+    ParticleEmitter*                  emitter;
+    float                             agility;
+    float                             maxVelocity;
+    float                             speed;
+    Vector                            diffVector ;
+    Vector                            correctionVector;
+
+    Vector                            curDir;
+    Vector                            lastDir;
+    Vector                            oldPos;
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+
+    Vector newDirection(Vector curDirection, Vector estTargetDir, float angle);
+
+    // spinning missle
+    float                             rotationSpeed;
+    float                             angle;
+};
+
+#endif /* _SWARM_PROJECTILE_H */
Index: trunk/src/world_entities/sound_entity.cc
===================================================================
--- trunk/src/world_entities/sound_entity.cc	(revision 10351)
+++ trunk/src/world_entities/sound_entity.cc	(revision 10368)
@@ -17,4 +17,5 @@
 #include "sound_entity.h"
 
+#include "util/loading/load_param.h"
 #include "util/loading/factory.h"
 #include "material.h"
@@ -43,5 +44,4 @@
     this->loadParams(root);
 
-  this->thunderBuffer = OrxSound::ResourceSoundBuffer("sounds/atmosphere/thunder.wav");
 }
 
@@ -53,5 +53,4 @@
 {
 }
-
 
 /**
@@ -73,5 +72,5 @@
  * @param fileName name of the sound source
  */
-void SoundEntity::setSoundFile(const std::string fileName)
+void SoundEntity::setSoundFile(const std::string& fileName)
 {
   this->soundBuffer = OrxSound::ResourceSoundBuffer(fileName);
Index: trunk/src/world_entities/sound_entity.h
===================================================================
--- trunk/src/world_entities/sound_entity.h	(revision 10351)
+++ trunk/src/world_entities/sound_entity.h	(revision 10368)
@@ -28,5 +28,5 @@
     virtual void loadParams(const TiXmlElement* root);
 
-    void setSoundFile(const std::string fileName);
+    void setSoundFile(const std::string& fileName);
 
     virtual void activate();
Index: trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.cc	(revision 10351)
+++ trunk/src/world_entities/space_ships/space_ship.cc	(revision 10368)
@@ -23,9 +23,24 @@
 
 #include "weapons/test_gun.h"
+#include "weapons/light_blaster.h"
+#include "weapons/medium_blaster.h"
+#include "weapons/heavy_blaster.h"
+#include "weapons/swarm_launcher.h"
+#include "weapons/spike_launcher.h"
+#include "weapons/spike_thrower.h"
+#include "weapons/acid_launcher.h"
+#include "weapons/boomerang_gun.h"
 #include "weapons/turret.h"
 #include "weapons/cannon.h"
 
+#include "elements/glgui_energywidgetvertical.h"
+#include "glgui_bar.h"
+
 #include "particles/dot_emitter.h"
+#include "particles/emitter_node.h"
 #include "particles/sprite_particles.h"
+#include "effects/trail.h"
+
+#include "effects/wobblegrid.h"
 
 #include "util/loading/factory.h"
@@ -44,11 +59,16 @@
 #include "state.h"
 #include "player.h"
+#include "camera.h"
+
 
 #include "util/loading/load_param.h"
+#include "time.h"
+
+#include "track/track.h"
+#include "math.h"
 
 
 // #include "lib/gui/gl_gui/glgui_bar.h"
 // #include "lib/gui/gl_gui/glgui_pushbutton.h"
-
 
 
@@ -70,4 +90,5 @@
                         ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
                         ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
+                        //->addMethod("setCameraSpeed", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraSpeed))
                        );
 
@@ -85,4 +106,7 @@
  */
 SpaceShip::SpaceShip(const std::string& fileName)
+    : secWeaponMan(this) //,
+    //supportedPlaymodes(Playable::Vertical) ,
+    //playmode(Playable::Vertical)
 {
   this->init();
@@ -105,6 +129,10 @@
 */
 SpaceShip::SpaceShip(const TiXmlElement* root)
+    : secWeaponMan(this) //,
+    //supportedPlaymodes(Playable::Vertical) ,
+    //playmode(Playable::Vertical)
 {
   this->init();
+  //this->setParentMode(PNODE_REPARENT_DELETE_CHILDREN);
   if (root != NULL)
     this->loadParams(root);
@@ -118,54 +146,138 @@
 void SpaceShip::init()
 {
+
+  srand(time(0));   //initialize Random Nomber Generator
+
   //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
   this->registerObject(this, SpaceShip::_objectList);
-
   PRINTF(4)("SPACESHIP INIT\n");
-
+  this->weaponMan.setParentEntity( this);
   //weapons:
-  Weapon* wpRight = new TestGun(0);
-  wpRight->setName("testGun Right");
-  Weapon* wpLeft = new TestGun(1);
-  wpLeft->setName("testGun Left");
-  //Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_CANNON));
-
-  //cannon->setName("BFG");
-
-  this->addWeapon(wpLeft, 1, 0);
-  this->addWeapon(wpRight,1 ,1);
-  //this->addWeapon(cannon, 0, 6);
-
-  this->getWeaponManager().changeWeaponConfig(1);
-
-  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
-
-  xMouse = yMouse = 0;
-  yInvert = 1;
-  mouseSensitivity = 0.001;
-  airViscosity = 0.9;
-  controlVelocityX = 25;
-  controlVelocityY = 150;
-  shipInertia = 1.5;
-  //  cycle = 0.0;
-
-  this->setHealthMax(100);
-  this->setHealth(80);
-
-  travelSpeed = 0.0;
-  acceleration = 3;
-  this->velocity = this->getAbsDirX()*travelSpeed;
-  this->mouseDir = this->getAbsDir();
-  this->pitchDir = this->getAbsDir();
-
-  //   GLGuiButton* button = new GLGuiPushButton();
-  //    button->show();
-  //    button->setLabel("orxonox");
-  //    button->setBindNode(this);
-  //     GLGuiBar* bar = new GLGuiBar();
-  //     bar->show();
-  //     bar->setValue(7.0);
-  //     bar->setMaximum(10);
-  //     bar->setSize2D( 20, 100);
-  //     bar->setAbsCoor2D( 10, 200);
+
+  Weapon* wpRight1 = new LightBlaster ();
+  wpRight1->setName( "LightBlaster");
+  Weapon* wpLeft1 = new LightBlaster ();
+  wpLeft1->setName( "LightBlaster");
+
+  Weapon* wpRight2 = new MediumBlaster ();
+  wpRight2->setName( "MediumBlaster");
+  Weapon* wpLeft2 = new MediumBlaster ();
+  wpLeft2->setName( "MediumBlaster");
+
+  Weapon* wpRight3 = new HeavyBlaster (1);
+  wpRight3->setName( "HeavyBlaster");
+  Weapon* wpLeft3 = new HeavyBlaster (0);
+  wpLeft3->setName( "HeavyBlaster");
+
+  Weapon* cannon = new SwarmLauncher();
+  cannon->setName( "SwarmLauncher");
+
+  Weapon* spike = new SpikeThrower();
+  spike->setName( "SpikeThrower" );
+
+
+  Weapon* acid0 = new AcidLauncher();
+  acid0->setName( "AcidSplasher" );
+
+  Weapon* acid1 = new AcidLauncher();
+  acid1->setName( "AcidSplasher" );
+
+
+  this->weaponMan.addWeapon( wpLeft1, 0, 0);
+  this->weaponMan.addWeapon( wpRight1, 0, 1);
+
+  this->weaponMan.addWeapon( wpLeft2, 1, 2);
+  this->weaponMan.addWeapon( wpRight2, 1, 3);
+
+  this->weaponMan.addWeapon( wpLeft3, 2, 4);
+  this->weaponMan.addWeapon( wpRight3, 2, 5);
+/*
+  this->weaponMan.addWeapon( wpLeft1, 3, 0);
+  this->weaponMan.addWeapon( wpRight1, 3, 1);
+
+  this->weaponMan.addWeapon( wpLeft2, 3, 2);
+  this->weaponMan.addWeapon( wpRight2, 3, 3);
+
+  this->weaponMan.addWeapon( wpLeft3, 3, 4);
+  this->weaponMan.addWeapon( wpRight3, 3, 5);
+*/
+
+  this->weaponMan.addWeapon( acid0, 3, 0);
+  this->weaponMan.addWeapon( acid1, 3, 1);
+
+
+  this->secWeaponMan.addWeapon( cannon, 0, 2);
+  this->secWeaponMan.addWeapon( spike, 1, 3);
+//   this->secWeaponMan.addWeapon( acid0, 2, 2);
+//   this->secWeaponMan.addWeapon( acid1, 2, 3);
+
+
+  this->weaponMan.changeWeaponConfig(3);
+  this->secWeaponMan.changeWeaponConfig(1);
+
+  curWeaponPrimary    = 0;
+  curWeaponSecondary  = 1;
+
+  Playable::weaponConfigChanged();
+
+  reactorOutput     = 10;
+
+  weaponEnergyRegen = 10;       // 10 einheiten pro Sekunde
+  engineSpeedBase   = 5;
+  shieldRegen       = 2;
+
+  shieldEnergyShare = 0.3;
+  weaponEnergyShare = 0.3;
+  engineEnergyShare = 0.4;
+
+  shieldCur         = 20;
+  shieldMax         = 100;
+  shieldTH          = .2 * shieldMax;   // shield power must be 20% before shield kicks in again
+
+  this->setHealth( 20);
+  this->setHealthMax( 100);
+
+  electronicCur = 50;
+  electronicMax = 50;
+  electronicRegen   = 3;
+  electronicTH      = .7 * electronicMax; // 30% of eDamage can be handled by the ship
+
+
+  this->loadModel("models/ships/mantawing.obj");
+  //this->setVisibiliy(false);
+
+  bForward = bBackward = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
+
+  this->setHealthMax(shieldMax);
+  this->setHealth(shieldCur);
+
+  this->travelNode = new PNode();
+
+  // camera - issue
+  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
+
+  // widget handling
+  /*
+  this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+  this->electronicWidget->setDisplayedName(std::string(this->getClassName()) + " Electronics:");
+  this->electronicWidget->setSize2D(30,400);
+  this->electronicWidget->setAbsCoor2D(150,200);
+  this->electronicWidget->shiftDir2D(270);
+  this->updateElectronicWidget();
+  this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+  this->shieldWidget->setDisplayedName(std::string(this->getClassName()) + " Shield:");
+  this->shieldWidget->setSize2D(30,400);
+  this->shieldWidget->setAbsCoor2D(200,200);
+  this->shieldWidget->shiftDir2D(270);
+  this->updateShieldWidget();
+  if (this->hasPlayer())
+  {
+    State::getPlayer()->hud().setShiledWidget(this->shieldWidget);
+    State::getPlayer()->hud().setEnergyWidget(this->electronicWidget);
+  }
+  */
+  this->electronicWidget = NULL;
+  this->shieldWidget = NULL;
 
   //add events to the eventlist
@@ -177,4 +289,5 @@
   //registerEvent(SDLK_e);
   registerEvent(KeyMapper::PEV_FIRE1);
+  registerEvent(KeyMapper::PEV_FIRE2);                  // Added for secondary weapon support
   registerEvent(KeyMapper::PEV_NEXT_WEAPON);
   registerEvent(KeyMapper::PEV_PREVIOUS_WEAPON);
@@ -183,68 +296,112 @@
   registerEvent(EV_MOUSE_MOTION);
 
-  this->getWeaponManager().setSlotCount(7);
-
-  this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
-  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0));
-  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
-  this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
-
-  this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
-  this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
-
-  this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
-  this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
-
-  this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
-  this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
-  //
-  this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
-  this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-  //
-  //   this->getWeaponManager().setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
-  //   this->getWeaponManager().setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
-  //
-  //   this->getWeaponManager().setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
-  //   this->getWeaponManager().setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
-
-  this->getWeaponManager().getFixedTarget()->setParent(this);
-  this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0);
-
-  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
-
-  this->burstEmitter = new DotEmitter(200, 0.0, .01);
-  this->burstEmitter->setParent(this);
-  this->burstEmitter->setRelCoor(-1, .5, 0);
-  this->burstEmitter->setName("SpaceShip_Burst_emitter");
-
-  this->burstSystem = new SpriteParticles(1000);
-  this->burstSystem->addEmitter(this->burstEmitter);
-  this->burstSystem->setName("SpaceShip_Burst_System");
-  ((SpriteParticles*)this->burstSystem)->setMaterialTexture("textures/radial-trans-noise.png");
-  this->burstSystem->setLifeSpan(1.0, .3);
-  this->burstSystem->setRadius(0.0, 1.0);
-  this->burstSystem->setRadius(0.05, 1.0);
-  this->burstSystem->setRadius(.5, .8);
-  this->burstSystem->setRadius(1.0, 0);
-  this->burstSystem->setColor(0.0, .7,.7,1,.7);
-  this->burstSystem->setColor(0.2, 0,0,0.8,.5);
-  this->burstSystem->setColor(0.5, .5,.5,.8,.8);
-  this->burstSystem->setColor(1.0, .8,.8,.8,.0);
-
-  registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity", PERMISSION_MASTER_SERVER ) );
-  registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mousedir", PERMISSION_OWNER ) );
-
-  registerVar( new SynchronizeableBool( &bUp, &bUp, "bUp", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableBool( &bDown, &bDown, "bDown", PERMISSION_OWNER ) );
+  this->weaponMan.setParentEntity( this);
+  this->secWeaponMan.setParentEntity( this);
+
+  this->weaponMan.setSlotCount(8);
+
+  this->weaponMan.setSlotPosition(0, Vector(0.0, 0, -3.0));
+  this->weaponMan.setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->weaponMan.setSlotPosition(1, Vector(0.0, 0, 3.0));
+  this->weaponMan.setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->weaponMan.setSlotPosition(2, Vector(1.0, 0, -1.5));
+  this->weaponMan.setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
+
+  this->weaponMan.setSlotPosition(3, Vector(1.0, 0, 1.5));
+  this->weaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
+
+  this->weaponMan.setSlotPosition(4, Vector(1.5, 0, .5));
+  this->weaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
+
+  this->weaponMan.setSlotPosition(5, Vector(1.5, 0, -.5));
+  this->weaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
+
+  this->weaponMan.setSlotPosition(6, Vector(0.5, 0, 2.5));
+  this->weaponMan.setSlotDirection(6, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
+
+  this->weaponMan.setSlotPosition(7, Vector(0.5, 0, -2.5));
+  this->weaponMan.setSlotDirection(7, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
+
+  this->secWeaponMan.setSlotPosition(0, Vector(1.5, 0, 0));
+  this->secWeaponMan.setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->secWeaponMan.setSlotPosition(1, Vector(2.6, 0, 3.0));
+  this->secWeaponMan.setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->secWeaponMan.setSlotPosition(2, Vector(1.5, 0, -.5));
+  this->secWeaponMan.setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
+
+  this->secWeaponMan.setSlotPosition(3, Vector(1.5, 0, .5));
+  this->secWeaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
+
+  this->secWeaponMan.setSlotPosition(4, Vector(1.5, 0, .5));
+  this->secWeaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
+
+  this->secWeaponMan.setSlotPosition(5, Vector(1.5, 0, -.5));
+  this->secWeaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
+
+
+  this->weaponMan.getFixedTarget()->setParent(this);
+  this->weaponMan.getFixedTarget()->setRelCoor(100000,0,0);
+
+
+  this->secWeaponMan.getFixedTarget()->setParent(this);
+  this->secWeaponMan.getFixedTarget()->setRelCoor(100000,0,0);
+  this->secWeaponMan.setRotationSpeed(0);
+
+  dynamic_cast<Element2D*>(this->weaponMan.getFixedTarget())->setVisibility( false);
+
+
+  registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
   registerVar( new SynchronizeableBool( &bLeft, &bLeft, "bLeft", PERMISSION_OWNER ) );
   registerVar( new SynchronizeableBool( &bRight, &bRight, "bRight", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableBool( &bAscend, &bAscend, "bAscend", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableBool( &bDescend, &bDescend, "bDescend", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableBool( &bRollL, &bRollL, "bRollL", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableBool( &bRollR, &bRollR, "bRollR", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableFloat( &cameraLook, &cameraLook, "cameraLook", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bFire, &bFire, "bSecFire", PERMISSION_OWNER));
+  registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity", PERMISSION_MASTER_SERVER ) );
+
+  //this->airFriction = 0.5f;
+  //this->travelDistancePlus = Vector2D(38.0, 43.0);
+  //this->travelDistanceMinus = Vector2D(-38.0, -43.0);
+  this->travelDistancePlus = Vector2D(50,50);
+  this->travelDistanceMinus = Vector2D(-50,-50);
+  this->isTravelDistanceInit = true;
+  this->actionWidthPercentage = 1;
+
+  this->cameraSpeed = 40;
+  this->cameraLook = 0.0f;
+  //this->airFriction = 0.0f;
+
+  srand(time(0));  //initaialize RNG
+
+  this->travelNode->debugDraw();
+
+  this->setSupportedPlaymodes(Playable::Horizontal | Playable::Vertical);
+
+  /// FIXME
+  this->trail = new Trail( 5, 10, .2, this);
+  this->trail->setTexture( "maps/engine.png");
+
+  this->trailL = new Trail( 5, 10, .2, this);
+  this->trailL->setTexture( "maps/engine.png");
+
+  this->trailR = new Trail( 5, 10, .2, this);
+  this->trailR->setTexture( "maps/engine.png");
+
+
+  this->toList(OM_GROUP_00);
+
+  //FIXME Just testaddition to show the wobblegrid
+/*
+  this->test  = new Wobblegrid(5);
+  test->setTexture("maps/blub.png");
+
+  test->setAbsCoor( this->getAbsCoor() + Vector(0, 2, 0));
+  test->setParent( this);
+*/
+
 }
 
@@ -257,17 +414,24 @@
 {
   Playable::loadParams(root);
-}
-
-void SpaceShip::setPlayDirection(const Quaternion& quat, float speed)
-{
-  this->mouseDir = quat;
-}
-
+
+  LoadParam(root, "playmode", this, SpaceShip, setPlaymodeXML);
+  LoadParam(root, "cameraDistance", this, SpaceShip, setCameraDistance);
+  LoadParam(root, "cameraFovy", this, SpaceShip, setCameraFovy);
+  LoadParam(root, "actionWidthPercentage", this, SpaceShip, setActionWidthPercentage);
+
+  State::getCamera()->setViewMode(Camera::ViewTop);
+}
+
+
+void SpaceShip::setPlayDirection(const Quaternion& rot, float speed)
+{
+  //this->direction = Quaternion (rot.getHeading(), Vector(0,1,0));
+}
 
 void SpaceShip::reset()
 {
-  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
-
-  xMouse = yMouse = 0;
+  bForward = bBackward = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
+
+  //xMouse = yMouse = 0;
 
   this->setHealth(80);
@@ -278,12 +442,23 @@
 void SpaceShip::enter()
 {
-  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
-  this->attachCamera();
+  this->secWeaponMan.showCrosshair();
+  this->toList( OM_GROUP_01 );
+  State::getPlayer()->hud().setRadarCenterNode(this->travelNode);
+  State::getPlayer()->hud().setOverlayActive(true);
+  //dynamic_cast <OrxGui::GLGuiEnergyWidgetVertical*> (State::getPlayer()->hud().getArmorWidget())->setDisplayedName("Armor");
+  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( true);
+  //this->attachCamera();
+ // this->setPlaymode(Playable::Horizontal);
 }
 
 void SpaceShip::leave()
 {
-  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
-  this->detachCamera();
+  this->secWeaponMan.hideCrosshair();
+  this->toList( OM_GROUP_00);
+  State::getPlayer()->hud().setOverlayActive(false);
+  State::getCamera()->setEventHandling(true);
+  State::getPlayer()->hud().setRadarCenterNode(NULL);
+  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( false);
+  //this->detachCamera();
 }
 
@@ -294,4 +469,7 @@
 void SpaceShip::postSpawn ()
 {
+  if(this->hasPlayer())
+    Playable::postSpawn();
+
   //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
 }
@@ -301,16 +479,9 @@
 */
 void SpaceShip::leftWorld ()
-{}
+{
+
+}
 
 WorldEntity* ref = NULL;
-/**
- *  this function is called, when two entities collide
- * @param entity: the world entity with whom it collides
- *
- * Implement behaviour like damage application or other miscellaneous collision stuff in this function
- */
-void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)
-{
-}
 
 /**
@@ -321,4 +492,22 @@
   WorldEntity::draw();
 
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x-1, this->getAbsCoor ().y-.2, this->getAbsCoor ().z);
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  //glScalef(2.0, 2.0, 2.0);  // no double rescale
+	// FIXME
+  this->trail->draw();
+
+  glTranslatef(0,0,-.5);
+  this->trailL->draw();
+
+  glTranslatef(0,0,1);
+  this->trailR->draw();
+
+  glPopMatrix();
   //this->debug(0);
 }
@@ -330,160 +519,79 @@
 void SpaceShip::tick (float time)
 {
-  Playable::tick(time);
-
-  if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() )
-  {
-    if (xMouse > controlVelocityX) xMouse = controlVelocityX;
-    else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX;
-    if (yMouse > controlVelocityY) yMouse = controlVelocityY;
-    else if (yMouse < -controlVelocityY) yMouse = -controlVelocityY;
-
-    pitchDir = (Quaternion(xMouse*mouseSensitivity*0.5, Vector(1,0,0)));
-
-    mouseDir *= (Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity*yInvert, Vector(0,0,1))*pitchDir);
-    xMouse = yMouse = 0;
-  }
-
-
-  //   if( this != State::getPlayer()->getControllable())
-  //     return;
-
-  // spaceship controlled movement fire(bool bF){ this->bFire = bF;}
-  //if (this->getOwner() == this->getHostID())
-  this->calculateVelocity(time);
-
-
-  Vector move = velocity*time;
-
-  //orient the velocity in the direction of the spaceship.
-  travelSpeed = velocity.len();
-  velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;
-  velocity = (velocity.getNormalized())*travelSpeed;
-  this->burstEmitter->setEmissionRate(travelSpeed);
-  this->burstEmitter->setEmissionVelocity(travelSpeed*.5, travelSpeed *.1);
+  // Playable::tick(time);
+
+ // this->test->tick(time);
+
+  // Own Tick Setup, as a different fire routine is used on the weapon manager
+  this->weaponMan.tick(time);
+  this->secWeaponMan.tick(time);
+
+  if( this->systemFailure() )
+    bFire = bSecFire = false;
+
+  // fire reqeust/release for primary weapons
+  if( this->bFire)
+    this->weaponMan.fire();
+  else
+    this->weaponMan.releaseFire();
+
+  // fire reqeust/release for secondary weapons
+  if( this->bSecFire)
+    this->secWeaponMan.fire();
+  else
+    this->secWeaponMan.releaseFire();
+
+  // Tracktick
+  if(this->entityTrack)
+    this->entityTrack->tick(time);
+
+
+  // Shield Regeneration and other regular calculations on the ship
+  this->regen(time);
+
+  // Weapon Regeneration and other regular calculations on the ship
+  this->weaponRegen(time);
+
+  // current engine speed output
+  this->engineSpeedCur = this->engineSpeedBase + this->reactorOutput * this->engineEnergyShare;
+
+  // calculation of maxSpeed and acceleration:
+  this->travelSpeed = this->engineSpeedCur * 5;
+  this->acceleration = this->travelSpeed * 2;
+
+  this->movement(time);
+
+   // TRYING TO FIX PNode.
+  this->cameraNode.setAbsCoorSoft(this->getAbsCoor() + Vector(0.0f, 5.0f, 0.0f), 30.0f);
+  this->cameraNode.setRelDirSoft(this->getAbsDir(), 30.0f);
+
+
+  this->velocity  = (this->getAbsCoor() - this->oldPos) / time;
+  this->oldPos    = this->getAbsCoor();
+
+//FIXME
+  this->trail->tick(time);
+  this->trailL->tick(time);
+  this->trailR->tick(time);
+
+  if (!this->isTravelDistanceInit)
+  {
+    this->updateTravelDistance();
+    //this->isTravelDistanceInit = true;
+  }
 
   //orient the spaceship in direction of the mouse
+  /*
   rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, 0.5);//fabsf(time)*shipInertia);
   if (this->getAbsDir().distance(rotQuat) > 0.00000000000001)
     this->setAbsDir( rotQuat);
   //this->setAbsDirSoft(mouseDir,5);
-
-  // this is the air friction (necessary for a smooth control)
-  if(travelSpeed >= 120) velocity -= velocity.getNormalized()*travelSpeed*travelSpeed*0.0001;
-  else if (travelSpeed <= 80) velocity -= velocity.getNormalized()*travelSpeed*0.001;
-
-  //other physics (gravity)
-  //if(travelSpeed < 120)
-  //move += Vector(0,-1,0)*60*time + Vector(0,1,0)*travelSpeed/2*time;
-
-  //hoover effect
-  //cycle += time;
-  //this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);
-
-  //readjust
-  //if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0)));
-  //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0)));
-
-  //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
-
+  */
+  /*
   this->shiftCoor(move);
+  */
 
   //   PRINTF(0)("id of %s is: %i\n", this->getName(), this->getOMListNumber());
 
-}
-
-/**
- *  calculate the velocity
- * @param time the timeslice since the last frame
-*/
-void SpaceShip::calculateVelocity (float time)
-{
-  Vector accel(0.0, 0.0, 0.0);
-  /*
-  Vector rot(0.0, 0.0, 0.0); // wird ben�igt fr Helicopter
-  */
-  //float rotVal = 0.0;
-  /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
-  /* calculate the direction in which the craft is heading  */
-
-  //Plane plane(Vector(0,1,0), Vector(0,0,0));
-
-  if( this->bUp )
-  {
-    //this->shiftCoor(this->getAbsDirX());
-    //accel += (this->getAbsDirX())*2;
-    accel += (this->getAbsDirX())*acceleration;
-
-  }
-
-  if( this->bDown )
-  {
-    //this->shiftCoor((this->getAbsDirX())*-1);
-    //accel -= (this->getAbsDirX())*2;
-    //if(velocity.len() > 50)
-    accel -= (this->getAbsDirX())*0.5*acceleration;
-
-
-
-  }
-
-  if( this->bLeft/* > -this->getRelCoor().z*2*/)
-  {
-    this->shiftDir(Quaternion(time, Vector(0,1,0)));
-    //    accel -= rightDirection;
-    //velocityDir.normalize();
-    //rot +=Vector(1,0,0);
-    //rotVal -= .4;
-  }
-  if( this->bRight /* > this->getRelCoor().z*2*/)
-  {
-    this->shiftDir(Quaternion(-time, Vector(0,1,0)));
-
-    //    accel += rightDirection;
-    //velocityDir.normalize();
-    //rot += Vector(1,0,0);
-    //rotVal += .4;
-  }
-
-
-  if( this->bRollL /* > -this->getRelCoor().z*2*/)
-  {
-    mouseDir *= Quaternion(-time*2, Vector(1,0,0));
-    //    accel -= rightDirection;
-    //velocityDir.normalize();
-    //rot +=Vector(1,0,0);
-    //rotVal -= .4;
-  }
-  if( this->bRollR /* > this->getRelCoor().z*2*/)
-  {
-    mouseDir *= Quaternion(time*2, Vector(1,0,0));
-
-    //    accel += rightDirection;
-    //velocityDir.normalize();
-    //rot += Vector(1,0,0);
-    //rotVal += .4;
-  }
-  if (this->bAscend )
-  {
-    this->shiftDir(Quaternion(time, Vector(0,0,1)));
-
-    //    accel += upDirection;
-    //velocityDir.normalize();
-    //rot += Vector(0,0,1);
-    //rotVal += .4;
-  }
-  if (this->bDescend )
-  {
-    this->shiftDir(Quaternion(-time, Vector(0,0,1)));
-
-    //    accel -= upDirection;
-    //velocityDir.normalize();
-    //rot += Vector(0,0,1);
-    //rotVal -= .4;
-  }
-
-  velocity += accel*time*10;
-  //rot.normalize();
-  //this->setRelDirSoft(Quaternion(rotVal, rot), 5);
 }
 
@@ -493,32 +601,569 @@
 void SpaceShip::process(const Event &event)
 {
-  Playable::process(event);
+  //Playable::process(event);
 
   if( event.type == KeyMapper::PEV_LEFT)
-    this->bRollL = event.bPressed;
+    this->bLeft = event.bPressed;
   else if( event.type == KeyMapper::PEV_RIGHT)
-    this->bRollR = event.bPressed;
+  {
+    this->bRight = event.bPressed;
+    printf("ShipCoorX: %f \n", this->getRelCoor().x);
+  }
   else if( event.type == KeyMapper::PEV_FORWARD)
-    this->bUp = event.bPressed; //this->shiftCoor(0,.1,0);
+  {
+    this->bForward = event.bPressed; //this->shiftCoor(0,.1,0);
+
+  }
   else if( event.type == KeyMapper::PEV_BACKWARD)
-    this->bDown = event.bPressed; //this->shiftCoor(0,-.1,0);
+    this->bBackward = event.bPressed; //this->shiftCoor(0,-.1,0);
+  else if( event.type == KeyMapper::PEV_FIRE2)
+    this->bSecFire = event.bPressed;
+  else if( event.type == KeyMapper::PEV_FIRE1)
+    this->bFire = event.bPressed;
+  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
+  {
+    this->nextWeaponConfig();
+  }
+  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
+    this->previousWeaponConfig();
+
+  if (!(State::getCamera()->getEventHandling()))
+  {
+    if( event.type == KeyMapper::PEV_VIEW0)
+    {
+      State::getCamera()->setViewMode(Camera::ViewNormal);
+      State::getCameraTargetNode()->setParent(this);
+      State::getCamera()->setParent(this);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW1)
+    {
+      State::getCamera()->setViewMode(Camera::ViewBehind);
+      State::getCameraTargetNode()->setParent(this);
+      State::getCamera()->setParent(this);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW2)
+    {
+      State::getCamera()->setViewMode(Camera::ViewFront);
+      State::getCameraTargetNode()->setParent(this);
+      State::getCamera()->setParent(this);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW3)
+    {
+      State::getCamera()->setViewMode(Camera::ViewLeft);
+      State::getCameraTargetNode()->setParent(this);
+      State::getCamera()->setParent(this);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW4)
+    {
+      State::getCamera()->setViewMode(Camera::ViewRight);
+      State::getCameraTargetNode()->setParent(this);
+      State::getCamera()->setParent(this);
+    }
+    else if( event.type == KeyMapper::PEV_VIEW5)
+    {
+      State::getCamera()->setViewMode(Camera::ViewTop);
+      State::getCameraTargetNode()->setParent(this->travelNode);
+      State::getCamera()->setParent(this->travelNode);
+    }
+  }
+
+
+  /*
   else if( event.type == EV_MOUSE_MOTION)
   {
+
     this->xMouse += event.xRel;
     this->yMouse += event.yRel;
   }
+  */
 }
 
 void SpaceShip::destroy( WorldEntity* killer )
 {
-  PRINTF(0)("spaceship destroy\n");
+  if(this->hasPlayer())
+    Playable::destroy( killer);
+
+  PRINTF(5)("spaceship destroy\n");
+
+  EmitterNode* node  = NULL;
+  DotEmitter* emitter = NULL;
+  SpriteParticles*  explosionParticles  = NULL;
+
+  explosionParticles = new SpriteParticles(200);
+  explosionParticles->setName("SpaceShipExplosionParticles");
+  explosionParticles->setLifeSpan(.2, .3);
+  explosionParticles->setRadius(0.0, 10.0);
+  explosionParticles->setRadius(.5, 6.0);
+  explosionParticles->setRadius(1.0, 3.0);
+  explosionParticles->setColor(0.0, 1,1,1,.9);
+  explosionParticles->setColor(0.1,  1,1,0,.9);
+  explosionParticles->setColor(0.5, .8,.4,0,.5);
+  explosionParticles->setColor(1.0, .2,.2,.2,.5);
+
+
+  emitter = new DotEmitter( 2000, 70, 360);
+  //emitter->setSpread( 0, M_2_PI);
+  emitter->setEmissionRate( 200.0);
+  //emitter->setEmissionVelocity( 200.0);
+  //emitter->setSystem( explosionParticles);
+  //emitter->setAbsCoor( this->getAbsCoor());
+
+  node  = new EmitterNode( .1f);
+  node->setupParticle( emitter, explosionParticles);
+  node->setAbsDir( this->getAbsDir());
+  node->setVelocity( this->getVelocity() * .9f);
+  node->setAbsCoor( this->getAbsCoor());
+  if( !node->start())
+    PRINTF(0)("Explosion node not correctly started!");
+/*
+  PNode* node          = new PNode();
+  node->setAbsCoor(this->getAbsCoor());
+  Explosion* explosion = new Explosion();
+  explosion->explode( node, Vector(5,5,5));
+*/
+/*
+  if( this->hasPlayer())
+  {
+	this->setAbsCoor(Vector(-10000,10000,10000));
+	this->hide();
+  }
+  else
+  {*/
+    this->setAbsCoor( this->getAbsCoor() + Vector(100,0,0) + Vector(1,0,0) * VECTOR_RAND(150).dot(Vector(1,0,0)));
+  //}
+
 }
 
 void SpaceShip::respawn( )
 {
-  toList( OM_PLAYERS );
-}
-
-
-
-
+  Playable::respawn();
+}
+
+
+void SpaceShip::damage(float pDamage, float eDamage){
+  PRINTF(5)("ship hit for (%f,%f) \n",pDamage,eDamage);
+
+  if( this->shieldActive) {
+    if( this->shieldCur > pDamage) {
+      this->shieldCur = this->shieldCur - pDamage;
+    }
+    else { // shield <= pDamage
+      this->shieldCur -=pDamage;
+      this->shieldActive = false; //shield collapses
+      pDamage += this->shieldCur;
+      if( !this->shieldActive) {
+        this->armorCur -= pDamage / 2; // remaining damages hits armor at half rate
+        this->electronicCur -= eDamage;
+      }
+    }
+  }
+  else {
+    this->armorCur = this->armorCur - pDamage;
+    this->electronicCur = this->electronicCur - eDamage;
+  }
+  if( this->armorCur <= 0) { /* FIXME implement shipcrash*/ }
+    this->destroy(this);
+
+  updateElectronicWidget();
+  updateShieldWidget();
+
+  this->setHealth( this->armorCur);
+}
+
+
+void SpaceShip::regen(float time){
+  float tmp;
+  if (this->armorCur != this->armorMax || this->armorRegen != 0){
+    tmp = this->armorCur + this->armorRegen * time;
+    if ( tmp > electronicMax)
+      this->armorCur = this->armorMax;
+    else
+      this->armorCur = tmp;
+  }
+  if (this->shieldCur != this->shieldMax || this->shieldRegen != 0){
+    tmp =  this->shieldCur + (this->shieldRegen + this->reactorOutput * this->shieldEnergyShare) * time;
+    if( tmp > shieldMax)
+      this->shieldCur = this->shieldMax;
+    else
+      this->shieldCur = tmp;
+    this->shieldActive = ( this->shieldActive || this->shieldCur > shieldTH);
+
+    updateShieldWidget();
+  }
+
+  this->setHealth( this->shieldCur);      // FIXME currently just to test share system
+
+  if (this->electronicCur != this->electronicMax || this->electronicRegen != 0){
+    tmp = this->electronicCur + this->electronicRegen * time;
+    if ( tmp > electronicMax)
+      this->electronicCur = this->electronicMax;
+    else
+      this->electronicCur = tmp;
+
+    updateElectronicWidget();
+  }
+
+}
+
+
+/**
+ * Weapon regeneration
+ * does not use any reactor capacity, as it wouldn't work in a consistent way.
+ */
+void SpaceShip::weaponRegen(float time)
+{
+  float energy  = ( this->reactorOutput * this->weaponEnergyShare + this->weaponEnergyRegen) * time;
+  Weapon* weapon;
+  for( unsigned int i=0; i < this->weaponMan.getSlotCount(); i++)
+  {
+    weapon = this->weaponMan.getWeapon(i);
+    if( weapon != NULL && weapon->isActive())
+    {
+      weapon->increaseEnergy( energy);
+    }
+
+  }
+  // weaponMan.increaseAmmunition( weapon, energy);
+}
+
+
+void SpaceShip::enterPlaymode(Playable::Playmode playmode)
+{
+  switch(playmode)
+  {
+    case Playable::Full3D:
+      /*
+      if (State::getCameraNode != NULL)
+      {
+        Vector absCoor = this->getAbsCoor();
+        this->setParent(PNode::getNullParent());
+        this->setAbsCoor(absCoor);
+        State::getCameraNode()->setParentSoft(&this->cameraNode);
+        State::getCameraNode()->setRelCoorSoft(-10, 0,0);
+        State::getCameraTargetNode()->setParentSoft(&this->cameraNode);
+        State::getCameraTargetNode()->setRelCoorSoft(100, 0,0);
+
+      }
+      */
+      //break;
+
+      break;
+    case Playable::Horizontal:
+      if (State::getCameraNode != NULL)
+      {
+        this->debugNode(1);
+        this->travelNode->debugNode(1);
+
+        this->travelNode->setAbsCoor(this->getAbsCoor());
+        this->travelNode->updateNode(0.01f);
+
+        this->isTravelDistanceInit = false;
+
+        if(this->entityTrack)
+           this->travelNode->setParent(this->entityTrack->getTrackNode());
+
+        this->setParent(this->travelNode);
+        this->setRelCoor(0,0,0);
+
+        State::getCameraNode()->setParentSoft(this->travelNode);
+        //State::getCameraNode()->setParentSoft(this);
+        //State::getCameraNode()->setRelCoorSoft(-0.01, 40, 0);
+        State::getCameraTargetNode()->setParentSoft(this->travelNode);
+        //State::getCameraTargetNode()->setParentSoft(this);
+        //State::getCameraTargetNode()->setRelCoorSoft(0,0,0);
+        this->setCameraMode(Camera::ViewTop);
+        State::getCamera()->setEventHandling(false);
+        registerEvent(KeyMapper::PEV_VIEW0);
+        registerEvent(KeyMapper::PEV_VIEW1);
+        registerEvent(KeyMapper::PEV_VIEW2);
+        registerEvent(KeyMapper::PEV_VIEW3);
+        registerEvent(KeyMapper::PEV_VIEW4);
+        registerEvent(KeyMapper::PEV_VIEW5);
+
+        State::getCamera()->setParentMode(PNODE_ALL);
+
+        //this->updateTravelDistance();
+
+        this->debugNode(1);
+        this->travelNode->debugNode(1);
+      }
+      break;
+
+    default:
+      PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName());
+  }
+}
+
+/**
+ * @brief calculate the velocity
+ * @param time the timeslice since the last frame
+*/
+
+void SpaceShip::movement (float dt)
+{
+  //by releasing the buttons, the velocity decreases with airCoeff*Acceleration. Should be strong enough so
+  //the ship doesn't slide too much.
+  float airCoeff = 2.5;
+  float pi = 3.14;
+
+  switch(this->getPlaymode())
+  {
+    case Playable::Horizontal:
+    {
+      // these routines will change the travel movement into zero in a short amout of time, if the player
+      // doesn't press any buttons.
+      if (this->travelVelocity.x >= 0)
+      {
+        if (this->travelVelocity.x > airCoeff*this->acceleration * dt)
+          this->travelVelocity.x -= airCoeff* this->acceleration * dt;
+        else
+          this->travelVelocity.x = 0;
+      }
+      else
+      {
+        if (this->travelVelocity.x < -airCoeff*this->acceleration * dt)
+          this->travelVelocity.x += airCoeff* this->acceleration * dt;
+        else
+          this->travelVelocity.x = 0;
+      }
+      if (this->travelVelocity.z >= 0)
+      {
+        if (this->travelVelocity.z > airCoeff*this->acceleration * dt)
+          this->travelVelocity.z -= airCoeff* this->acceleration * dt;
+        else
+          this->travelVelocity.z = 0;
+      }
+      else
+      {
+        if (this->travelVelocity.z < -airCoeff*this->acceleration * dt)
+          this->travelVelocity.z += airCoeff* this->acceleration * dt;
+        else
+          this->travelVelocity.z = 0;
+      }
+
+      // this will evite, that the ship moves outside the travelDistance- borders,when the player releases all buttons
+      // and its continuing to slide a bit.
+      Vector oldCoor = this->getRelCoor();
+      if (this->getRelCoor().x > this->travelDistancePlus.x) this->setRelCoor(this->travelDistancePlus.x, oldCoor.y, oldCoor.z);
+      if (this->getRelCoor().x < this->travelDistanceMinus.x) this->setRelCoor(this->travelDistanceMinus.x, oldCoor.y, oldCoor.z);
+      if (this->getRelCoor().z > this->travelDistancePlus.y) this->setRelCoor(oldCoor.x, oldCoor.y, this->travelDistancePlus.y);
+      if (this->getRelCoor().z < this->travelDistanceMinus.y) this->setRelCoor(oldCoor.x, oldCoor.y, this->travelDistanceMinus.y);
+
+      if( this->systemFailure() )
+        bForward = bBackward = bLeft = bRight = false;
+
+      if( this->bForward )
+      {
+        //printf("ShipCoorX: %f \n", this->getRelCoor().x);
+        if(this->getRelCoor().x < this->travelDistancePlus.x)
+        {
+          if (this->travelVelocity.x < this->travelSpeed)
+          {
+            this->travelVelocity.x += (airCoeff + 1.0)*this->acceleration*dt;
+          }
+          else
+          {
+            this->travelVelocity.x = this->travelSpeed;
+          }
+        }
+        else
+        {
+          this->travelVelocity.x = 0.0f;
+        }
+      }
+
+      if( this->bBackward )
+      {
+        if(this->getRelCoor().x > this->travelDistanceMinus.x)
+        {
+          if (this->travelVelocity.x > -this->travelSpeed)
+          {
+            this->travelVelocity.x -= (airCoeff + 1.0)*this->acceleration*dt;
+          }
+          else
+          {
+            this->travelVelocity.x = -this->travelSpeed;
+          }
+        }
+        else
+        {
+          this->travelVelocity.x = 0.0f;
+        }
+      }
+
+      if( this->bLeft)
+      {
+        if(this->getRelCoor().z > this->travelDistanceMinus.y)
+        {
+          if (this->travelVelocity.z > -this->travelSpeed)
+          {
+            this->travelVelocity.z -= (airCoeff + 1.0)*this->acceleration*dt;
+          }
+          else
+          {
+            this->travelVelocity.z = -this->travelSpeed;
+          }
+        }
+        else
+        {
+          this->travelVelocity.z = 0.0f;
+        }
+        this->setRelDirSoft(Quaternion(-pi/6, Vector(1,0,0)), 6);
+      }
+
+      if( this->bRight)
+      {
+        //printf("ShipCoorZ: %f \n", this->getRelCoor().z);
+        if(this->getRelCoor().z < this->travelDistancePlus.y)
+        {
+          if (this->travelVelocity.z < this->travelSpeed)
+          {
+            this->travelVelocity.z += (airCoeff + 1.0)*this->acceleration*dt;
+          }
+          else
+          {
+            this->travelVelocity.z = this->travelSpeed;
+          }
+        }
+        else
+        {
+          this->travelVelocity.z = 0.0f;
+        }
+        this->setRelDirSoft(Quaternion(pi/6, Vector(1,0,0)), 6);
+      }
+      if (!this->bRight && !this->bLeft)
+      {
+        this->setRelDirSoft(Quaternion(0, Vector(1,0,0)), 6);
+      }
+
+    //normalisation of the vectors (vector sum must be <= travelspeed)
+    float xzNorm = sqrt(pow(this->travelVelocity.x, 2) + pow(this->travelVelocity.z, 2));
+    if (xzNorm > this->travelSpeed)
+    {
+      this->travelVelocity.x = this->travelVelocity.x/xzNorm * this->travelSpeed;
+      this->travelVelocity.z = this->travelVelocity.z/xzNorm * this->travelSpeed;
+    }
+
+    //this moves camera and ship along the travel path.
+    if(!this->entityTrack)
+       this->travelNode->shiftCoor(Vector(this->cameraSpeed * dt, 0, 0));
+
+    break;
+    }
+    case Playable::Vertical:
+      break;
+    default:
+      PRINTF(4)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName());
+  }
+   //set new coordinates calculated through key- events.
+  this->shiftCoor (this->travelVelocity * dt);
+}
+
+void SpaceShip::setPlaymodeXML(const std::string& playmode)
+{
+  this->setPlaymode(Playable::stringToPlaymode(playmode));
+}
+
+/**
+ * @brief jumps to the next WeaponConfiguration
+ */
+void SpaceShip::nextWeaponConfig()
+{
+  PRINTF(0)("Requested next weapon config!\n");
+  this->weaponMan.nextWeaponConfig();
+  Playable::weaponConfigChanged();
+}
+
+/**
+ * @brief moves to the last WeaponConfiguration
+ */
+void SpaceShip::previousWeaponConfig()
+{
+  this->curWeaponPrimary    = (this->curWeaponPrimary + 1) % 3;
+  this->weaponMan.changeWeaponConfig(this->curWeaponPrimary);
+  Playable::weaponConfigChanged();
+}
+
+void SpaceShip::hit( float damage, WorldEntity* killer)
+{
+  this->damage(killer->getDamage(),0);
+}
+
+void SpaceShip::updateElectronicWidget()
+{
+  if (this->electronicWidget != NULL)
+  { //if it exists already: update it
+     this->electronicWidget->setMaximum(this->electronicMax);
+     this->electronicWidget->setValue(this->electronicCur);
+  }
+  else
+  { //create the widget
+    this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    this->electronicWidget->getBarWidget()->setChangedValueColor(Color(1,0,0,1));
+    //this->electronicWidget->setDisplayedName("Electronics:");
+    //this->electronicWidget->setSize2D(100,20);
+    //this->electronicWidget->setAbsCoor2D(150,200);
+    this->updateElectronicWidget();
+    if (this->hasPlayer())
+      State::getPlayer()->hud().setEnergyWidget(this->electronicWidget);
+  }
+}
+
+void SpaceShip::updateShieldWidget()
+{
+  if (this->shieldWidget != NULL)
+  {
+    this->shieldWidget->setMaximum(this->shieldMax);
+    this->shieldWidget->setValue(this->shieldCur);;
+  }
+  else
+  {
+    this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    this->shieldWidget->getBarWidget()->setChangedValueColor(Color(1,0,0,1));
+    //this->shieldWidget->setDisplayedName("Shield:");
+    //his->shieldWidget->setSize2D(100,20);
+    //this->shieldWidget->setAbsCoor2D(200,200);
+    this->updateShieldWidget();
+    if (this->hasPlayer())
+      State::getPlayer()->hud().setShiledWidget(this->shieldWidget);
+  }
+}
+
+void SpaceShip::setCameraDistance(float dist)
+{
+  State::getCamera()->setViewTopDistance(dist);
+}
+
+void SpaceShip::setCameraFovy(float fovy)
+{
+  State::getCamera()->setViewTopFovy(fovy);
+}
+
+void SpaceShip::updateTravelDistance()
+{
+  float x = 1.25 * this->actionWidthPercentage * fabsf(State::getCamera()->getAbsCoor().y) * tan(State::getCamera()->getFovy()*M_PI /360.0);
+  float y = x / State::getCamera()->getAspectRatio() / this->actionWidthPercentage;
+  //State::getCamera()->setAbsCoor(-5, 1000, 0);
+
+
+  //State::getCamera()->getAbsCoor().print();
+  //printf("CameraRelCoorY: %f \n", State::getCamera()->getRelCoor().y);
+
+  //printf("x: %f, y: %f \n", x, y);
+  this->travelDistancePlus = Vector2D(y, x);
+  this->travelDistanceMinus = Vector2D(-y, -x);
+
+  State::getPlayer()->hud().setOverlayPercentage(100-int(100*this->actionWidthPercentage));
+  PRINTF(0)("TravelDistance has been updated\n");
+  this->isTravelDistanceInit = true;
+}
+
+void SpaceShip::setActionWidthPercentage(int i)
+{
+  if (i>100) i=100;
+  if (i<0) i=0;
+  this->actionWidthPercentage = i/100.0;
+
+  if (this->hasPlayer())
+    this->isTravelDistanceInit = false;
+};
Index: trunk/src/world_entities/space_ships/space_ship.h
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.h	(revision 10351)
+++ trunk/src/world_entities/space_ships/space_ship.h	(revision 10368)
@@ -2,4 +2,7 @@
  * @file space_ship.h
  * Implements the Control of a Spaceship
+ * Space Ships are the core class for all types of ships in Orxonox
+ * By default is on OM_GROUP_00
+ * If player boards the ship, it is moved to OM_GROUP_01
  */
 
@@ -16,4 +19,6 @@
 class ParticleEmitter;
 class ParticleSystem;
+class Trail;
+class Wobblegrid;
 
 class SpaceShip : public Playable
@@ -29,4 +34,11 @@
 
     virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
+    /*
+    void setTravelHeight(float travelHeight);
+    void setTravelDistance(const Vector2D& distance);
+    void setTravelDistance(float x, float y);
+    */
+
+    //void setAirFriction(float friction) { this->airFriction = friction; };
 
     virtual void enter();
@@ -41,25 +53,111 @@
     virtual void respawn();
 
-    virtual void collidesWith(WorldEntity* entity, const Vector& location);
+    inline Vector getVelocity() { return this->velocity; };
+
     virtual void tick(float time);
     virtual void draw() const;
 
     virtual void process(const Event &event);
+//    virtual void hit (WorldEntity* entity, float damage);
+
+    inline WeaponManager& getWeaponManagerSecondary() { return this->secWeaponMan; };
+
+    //Functions for GUI
+    inline float getShieldCur() { return this->shieldCur; };        //!< returns current shield value
+    inline float getShieldMax() { return this->shieldMax; };        //!< returns maximum shield value
+
+    inline float getArmorCur() { return this->armorCur; };          //!< returns current armor value
+    inline float getArmorMax() { return this->armorMax; };          //!< returns current armor value
+
+    inline float getElectronicCur() { return this->electronicCur; }; //!< returns current electronic value
+    inline float getElectronicMax() { return this->electronicMax; }; //!< returns current electronic value
+
+    inline PNode* getTravelNode() { return this->travelNode; };
+
+    //damage handler
+    virtual void damage(float pDamage, float eDamage);  //!< pDamage physical damage, eDamage electronic damage
+
+    //included by Michel: 
+    virtual void enterPlaymode(Playable::Playmode playmode);
+    void setPlaymodeXML(const std::string& playmode); //recieves the playmode from a string (useful for script implementation)
+    void setActionWidthPercentage(int i);
+    void updateTravelDistance();
+    virtual void movement (float dt);
+
+    //
+
+    void nextWeaponConfig();
+    void previousWeaponConfig();
+
+    virtual void hit(float damage, WorldEntity* killer);
 
   private:
     void init();
 
-    void calculateVelocity(float time);
-
-    bool                  bUp;                //!< up button pressed.
-    bool                  bDown;              //!< down button pressed.
+    //void calculateVelocity(float time);
+
+    void regen(float time);  //!< handler for shield and electronic regeneration
+
+    void weaponRegen(float time);   //!< weapon energy regeneration
+
+    inline bool systemFailure() {  return (this->electronicCur < float(rand())/float(RAND_MAX) * this->electronicTH); };
+
+    void updateElectronicWidget();
+    void updateShieldWidget();
+
+    //WeaponManager         weaponMan;      //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping
+    WeaponManager         secWeaponMan;       //!< the secondary weapon manager: managing a list of special weapons to weapon-slot mapping
+    short                 supportedPlaymodes; //!< What Playmodes are Supported in this Playable.
+    Playable::Playmode    playmode;           //!< The current playmode.
+
+    //ship atributes
+    float       shieldCur;          //!< current shield
+    float       shieldMax;          //!< maximum shield
+    float       shieldEnergyShare;  //!< percentage of reactor output
+    float       shieldRegen;        //!< shield regeneration rate per second
+    float       shieldTH;           //!< shield threshhold for reactivation
+    bool        shieldActive;       //!< wheather the shield is working
+    OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar
+
+    float       armorCur;           //!< current armor
+    float       armorMax;           //!< maximum armor
+    float       armorRegen;         //!< armor regeneration per tick (usable on bioships?)
+    //note that the armor widget is set on the health- widget in world- entity (see in player.cc)
+
+    float       electronicCur;      //!< current electronic
+    float       electronicMax;      //!< maximum electronic
+    float       electronicRegen;    //!< electronic regenration rate per tick
+    float       electronicTH;       //!< Threshhold for electronic failure
+    OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar
+
+    float       engineSpeedCur;     //!< speed output for movement = speed base + energy share part
+    float       engineSpeedBase;    //!< speed base
+    int         enginePowerConsume; //!< energy needed
+    float       engineEnergyShare;  //!< percentage of reactor output
+
+    int         weaponEnergySlot;   //!< number of energy weapon slots
+    int         weaponEnergyUsed;
+    float       weaponEnergyShare;
+    float       weaponEnergyRegen;
+    int         weaponSpecialSlot;  //!< number of special weapon slots
+    int         weaponSpecialUsed;
+
+    float       reactorOutput;      //!< reactor output 
+    float       reactorCapacity;    //!< reactor capacity
+
+    int         curWeaponPrimary;   //!< current primary weapon config 
+    int         curWeaponSecondary; //!< current secondary weapon config
+
+    bool                  bForward;                //!< up button pressed.
+    bool                  bBackward;              //!< down button pressed.
     bool                  bLeft;              //!< left button pressed.
     bool                  bRight;             //!< right button pressed.
     bool                  bAscend;            //!< ascend button pressed.
     bool                  bDescend;           //!< descend button presses.
-//    bool                  bFire;              //!< fire button pressed.(moved to playable)
     bool                  bRollL;             //!< rolling button pressed (left)
     bool                  bRollR;             //!< rolling button pressed (right)
-
+    bool                  bSecFire;           //!< second fire button pressed
+
+    /*
     float                 xMouse;             //!< mouse moved in x-Direction
     float                 yMouse;             //!< mouse moved in y-Direction
@@ -68,8 +166,29 @@
     int                   controlVelocityX;
     int                   controlVelocityY;
-//    float                 cycle;              //!< hovercycle
+    */
 
     Vector                velocity;           //!< the velocity of the player.
-    Vector                oldVelocity;        //!< the velocity the player had last synced
+    Vector                oldPos;
+
+// 2D-traveling
+    PNode*                travelNode;
+    float                 travelSpeed;        //!< the current speed of the Ship (to make soft movement)
+    Vector                travelVelocity;     //!< object internal velocity vector for relative movement to the track node
+    Vector2D              travelDistancePlus;     //!< Travel-Distance away from the TravelNode
+    Vector2D              travelDistanceMinus;
+    bool                  isTravelDistanceInit;
+
+    float                 actionWidthPercentage;
+
+// Camera
+    PNode                 cameraNode;
+    float                 cameraLook;
+    float                 rotation;
+    float                 cameraSpeed;
+
+    void                  setCameraDistance(float dist);
+    void                  setCameraFovy(float fovy);
+
+    /*
     Quaternion            mouseDir;           //!< the direction where the player wants to fly
     Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
@@ -77,13 +196,19 @@
     Quaternion            rotQuat;
     Quaternion            pitchDir;
-    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
-    float                 acceleration;       //!< the acceleration of the player.
-
-    float                 airViscosity;
+    float                 dogdeSpeed;        //!< the dogde Speed of the ship.
+    */
+
+    //Quaternion            direction;          //!< the direction of the ship.
+    float                 acceleration;       //!< the acceleration of the ship.
+    //float                 airFriction;        //!< AirFriction.
+    //float                 airViscosity;
 
     byte                  oldMask;            //!< used for synchronisation
 
-    ParticleEmitter*      burstEmitter;
-    ParticleSystem*       burstSystem;
+    Trail*                trail;              //!< Burst trail
+    Trail*                trailL;              //!< Burst trail
+    Trail*                trailR;              //!< Burst trail
+
+
 };
 
Index: trunk/src/world_entities/space_ships/spacecraft_2d.cc
===================================================================
--- trunk/src/world_entities/space_ships/spacecraft_2d.cc	(revision 10351)
+++ trunk/src/world_entities/space_ships/spacecraft_2d.cc	(revision 10368)
@@ -273,5 +273,7 @@
 {
   dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
-  this->setPlaymode(this->getPlaymode());
+//   this->setPlaymode(this->getPlaymode());
+  this->setPlaymode(Playable::Horizontal);
+  this->setTravelSpeed(10.0f);
 }
 
Index: trunk/src/world_entities/space_ships/spacecraft_2d.h
===================================================================
--- trunk/src/world_entities/space_ships/spacecraft_2d.h	(revision 10351)
+++ trunk/src/world_entities/space_ships/spacecraft_2d.h	(revision 10368)
@@ -66,5 +66,4 @@
     float                 acceleration;       //!< the acceleration of the Spacecraft2D.
     float                 airFriction;        //!< AirFriction.
-
     float                 airViscosity;
 
Index: trunk/src/world_entities/test_entity.cc
===================================================================
--- trunk/src/world_entities/test_entity.cc	(revision 10351)
+++ trunk/src/world_entities/test_entity.cc	(revision 10368)
@@ -86,5 +86,40 @@
 }
 
+void TestEntity::draw() const
+{
+//   if(!mediaLoaded)
+//     false;
 
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+//   glDisable(GL_BLEND);
+// 
+//   glEnable(GL_TEXTURE_2D);
+//   glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
+
+  glPushMatrix();
+ /* glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  glRotatef(axis, 0.0f, 1.0f, 0.0f);*/
+//PRINTF(0)("axis: %f\n", axis);
+
+  glColor3f(1.0, 0, 0);
+
+  glBegin(GL_QUADS);
+    glVertex3f( 0.0f, -100.0f, 0.0f);
+//     glTexCoord2f(1.0f, 1.0f);
+    glVertex3f( 0.0f,  -100.0f , 2000.0f);
+//     glTexCoord2f(0.0f, 1.0f);
+    glVertex3f( 10000.0f,  -100.0f , 2000.0f );
+//     glTexCoord2f(0.0f, 0.0f);
+    glVertex3f( 10000.0f, -100.0f, 0.0f );
+//     glTexCoord2f(1.0f, 0.0f);
+    
+  glEnd();
+
+  glPopMatrix();
+  glPopAttrib();
+}
 
 /**
@@ -98,11 +133,4 @@
 
 
-/**
- *
- */
-void TestEntity::draw() const
-{
-
-}
 
 
Index: trunk/src/world_entities/test_entity2.cc
===================================================================
--- trunk/src/world_entities/test_entity2.cc	(revision 10368)
+++ trunk/src/world_entities/test_entity2.cc	(revision 10368)
@@ -0,0 +1,270 @@
+
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer:
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "executor/executor.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+
+#include "test_entity2.h"
+#include "debug.h"
+
+#include "state.h"
+#include "player.h"
+#include "playable.h"
+#include "material.h"
+
+
+#include "state.h"
+
+
+
+
+ObjectListDefinition(TestEntity2);
+CREATE_FACTORY(TestEntity2);
+
+
+
+/**
+ *
+ */
+TestEntity2::TestEntity2()
+{
+  this->init();
+}
+
+
+/**
+ *
+ */
+TestEntity2::TestEntity2(const TiXmlElement* root)
+{
+  this->init();
+
+  if( root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ *
+ */
+TestEntity2::~TestEntity2 ()
+{}
+
+
+/**
+ *
+ */
+void TestEntity2::init()
+{
+  this->registerObject(this, TestEntity2::_objectList);
+  this->toList(OM_GROUP_00);
+
+  this->material = new Material();
+  this->material->setIllum(3);
+  this->material->setDiffuse(1.0,1.0,1.0);
+  this->material->setSpecular(0.0,0.0,0.0);
+  this->material->setAmbient(1.0, 1.0, 1.0);
+
+  this->angle = 0;
+  this->rotationSpeed = 3;
+
+  this->material->setDiffuseMap("maps/TE2.tga");
+
+}
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void TestEntity2::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+}
+
+
+void TestEntity2::updateAngle()
+{
+  this->angle = this->angle + this->rotationSpeed;
+}
+
+void TestEntity2::draw() const
+{
+
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+
+  glPushMatrix();
+  glMatrixMode(GL_MODELVIEW);
+
+
+    /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                  this->getAbsCoor ().y,
+                  this->getAbsCoor ().z);
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+  glRotatef(this->angle, 1.0, 1.0, 1.0);
+//PRINTF(0)("axis: %f\n", axis);
+
+
+  glEnable(GL_BLEND);
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+  glShadeModel(GL_FLAT);
+  glClearColor(0.0, 0.0, 0.0, 0.0);
+
+  glEnable(GL_TEXTURE_2D);
+  this->material->select();
+
+  glColor3f(1.0, 1.0, 1.0);
+
+  glBegin(GL_QUADS); // +X
+    glTexCoord2f (0.0, 0.0);
+    glVertex3f( 0.0f, -0.5f, -0.5f);
+//     glNormal3f(1.0, 0.0, 0.0);
+
+    glTexCoord2f (1.0, 0.0);
+    glVertex3f( 0.0f, -0.5f , 0.5f);
+//     glNormal3f(1.0, 0.0, 0.0);
+
+    glTexCoord2f (1.0, 1.0);
+    glVertex3f( 0.0, 0.5f , 0.5f );
+//     glNormal3f(1.0, 0.0, 0.0);
+
+
+    glTexCoord2f (0.0, 1.0);
+    glVertex3f( 0.0, 0.5f, -0.5f );
+//     glNormal3f(1.0, 0.0, 0.0);
+  glEnd();
+
+  glBegin(GL_QUADS); // +Y
+    glTexCoord2f (0.0, 0.0);
+    glVertex3f(-0.5f, 0.0f, -0.5f);
+//     glNormal3f(0.0, 1.0, 0.0);
+
+    glTexCoord2f (1.0, 0.0);
+    glVertex3f(-0.5f, 0.0f , 0.5f);
+//     glNormal3f(0.0, 1.0, 0.0);
+
+    glTexCoord2f (1.0, 1.0);
+    glVertex3f( 0.5f, 0.0f , 0.5f );
+//     glNormal3f(0.0, 1.0, 0.0);
+
+    glTexCoord2f (0.0, 1.0);
+    glVertex3f( 0.5f, 0.0f, -0.5f );
+//     glNormal3f(0.0, 1.0, 0.0);
+  glEnd();
+
+  glBegin(GL_QUADS);// +Z
+    glTexCoord2f (0.0, 0.0);
+    glVertex3f(-0.5f, -0.5f, 0.0f);
+//     glNormal3f(0.0, 0.0, 1.0);
+
+    glTexCoord2f (1.0, 0.0);
+    glVertex3f(-0.5f, 0.5f , 0.0f);
+//     glNormal3f(0.0, 0.0, 1.0);
+
+    glTexCoord2f (1.0, 1.0);
+    glVertex3f( 0.5f, 0.5f , 0.0f );
+//     glNormal3f(0.0, 0.0, 1.0);
+
+    glTexCoord2f (0.0, 1.0);
+    glVertex3f( 0.5f, -0.5f, 0.0f );
+//     glNormal3f(0.0, 0.0, 1.0);
+  glEnd();
+
+/*
+  glBegin(GL_QUADS);// -X
+    glTexCoord2f (0.0, 0.0);
+    glVertex3f( 0.0f, -0.5f, -0.5f);
+//     glNormal3f(-1.0, 0.0, 0.0);
+
+    glTexCoord2f (1.0, 0.0);
+    glVertex3f( 0.0f, 0.5f , -0.5f);
+//     glNormal3f(-1.0, 0.0, 0.0);
+
+    glTexCoord2f (1.0, 1.0);
+    glVertex3f( 0.0, 0.5f , 0.5f );
+//     glNormal3f(-1.0, 0.0, 0.0);
+
+    glTexCoord2f (0.0, 1.0);
+    glVertex3f( 0.0, -0.5f, 0.5f );
+//     glNormal3f(-1.0, 0.0, 0.0);
+  glEnd();
+
+  glBegin(GL_QUADS);// -Y
+    glTexCoord2f (0.0, 0.0);
+    glVertex3f(-0.5f, 0.0f, -0.5f);
+//     glNormal3f(0.0, -1.0, 0.0);
+
+    glTexCoord2f (1.0, 0.0);
+    glVertex3f(0.5f, 0.0f , -0.5f);
+//     glNormal3f(0.0, -1.0, 0.0);
+
+    glTexCoord2f (1.0, 1.0);
+    glVertex3f( 0.5f, 0.0f , 0.5f );
+//     glNormal3f(0.0, -1.0, 0.0);
+
+    glTexCoord2f (0.0, 1.0);
+    glVertex3f( -0.5f, 0.0f, 0.5f );
+//     glNormal3f(0.0, -1.0, 0.0);
+  glEnd();
+
+  glBegin(GL_QUADS);// -Z
+    glTexCoord2f (0.0, 0.0);
+    glVertex3f(-0.5f, -0.5f, 0.0f);
+//     glNormal3f(0.0, 0.0, -1.0);
+
+    glTexCoord2f (1.0, 0.0);
+    glVertex3f(0.5f, -0.5f , 0.0f);
+//     glNormal3f(0.0, 0.0, -1.0);
+
+    glTexCoord2f (1.0, 1.0);
+    glVertex3f( 0.5f, 0.5f , 0.0f );
+//     glNormal3f(0.0, 0.0, -1.0);
+
+    glTexCoord2f (0.0, 1.0);
+    glVertex3f( -0.5f, 0.5f, 0.0f );
+//     glNormal3f(0.0, 0.0, -1.0);
+  glEnd();*/
+
+  glPopMatrix();
+  glPopAttrib();
+}
+
+/**
+ *
+ */
+void TestEntity2::tick (float time)
+{
+  Player* p = State::getPlayer();
+  Playable* pl = p->getPlayable();
+
+  this->setParent(pl);
+
+  this->updateAngle();
+}
+
+
+
+
+
+
Index: trunk/src/world_entities/test_entity2.h
===================================================================
--- trunk/src/world_entities/test_entity2.h	(revision 10368)
+++ trunk/src/world_entities/test_entity2.h	(revision 10368)
@@ -0,0 +1,33 @@
+#ifndef _TEST_ENTITY_H
+#define _TEST_ENTITY_H
+
+#include "world_entity.h"
+
+class TiXmlElement;
+class Material;
+
+class TestEntity2 : public WorldEntity
+{
+    ObjectListDeclaration(TestEntity2);
+
+  public:
+    TestEntity2 ();
+    TestEntity2(const TiXmlElement* root);
+    virtual ~TestEntity2 ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+
+    virtual void tick (float time);
+    virtual void draw() const;
+
+  private:
+    virtual void updateAngle();
+
+    Material*       material;
+    float           angle;
+    float           rotationSpeed;
+};
+
+#endif /* _TEST_ENTITY_H */
Index: trunk/src/world_entities/weapons/acid_launcher.cc
===================================================================
--- trunk/src/world_entities/weapons/acid_launcher.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/acid_launcher.cc	(revision 10368)
@@ -0,0 +1,164 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer
+   co-programmer:
+*/
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "acid_launcher.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/acid_splash.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include <list>
+#include <iterator>
+#include "util/state.h"
+
+#include "math/quaternion.h"
+
+#include "util/loading/factory.h"
+
+
+
+using namespace std;
+
+ObjectListDefinition(AcidLauncher);
+CREATE_FACTORY(AcidLauncher);
+
+/**
+ *  standard constructor
+ *
+ * creates a new AcidLauncher
+ */
+AcidLauncher::AcidLauncher()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new AcidLauncher from a TiXmlElement
+ */
+AcidLauncher::AcidLauncher(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+AcidLauncher::~AcidLauncher ()
+{
+  // model will be deleted from WorldEntity-destructor
+}
+
+void AcidLauncher::init()
+{
+  this->registerObject(this, AcidLauncher::_objectList);
+/*
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+*/
+  this->setStateDuration(WS_SHOOTING, 1.0f);
+
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(100);
+  this->increaseEnergy(100);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("AcidSplash");
+//   this->loadModel("models/guns/turret1.obj", 1.0);
+
+  this->setEmissionPoint(2.0, 0, 0);
+  this->getProjectileFactory()->prepare(10);
+
+  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void AcidLauncher::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void AcidLauncher::activate()
+{
+}
+
+void AcidLauncher::deactivate()
+{
+}
+
+void AcidLauncher::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+  /*
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+  */
+}
+
+void AcidLauncher::fire()
+{
+  bool fired  = false;
+
+  Projectile* pj = NULL;
+  for( int i=0; i < 1; i++)
+  {
+      pj  = this->getProjectile();
+      if (pj == NULL)
+        return;
+
+      fired = true;
+      pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(10)));
+
+      pj->setParent(PNode::getNullParent());
+      pj->setAbsCoor(this->getEmissionPoint() + VECTOR_RAND(.1));
+      pj->setAbsDir(this->getAbsDir()+Quaternion(0,VECTOR_RAND(5)));
+      pj->activate();
+  }
+}
Index: trunk/src/world_entities/weapons/acid_launcher.h
===================================================================
--- trunk/src/world_entities/weapons/acid_launcher.h	(revision 10368)
+++ trunk/src/world_entities/weapons/acid_launcher.h	(revision 10368)
@@ -0,0 +1,34 @@
+/*!
+ * @file acid_launcher.h
+*/
+
+
+#ifndef _ACID_LAUNCHER_H
+#define _ACID_LAUNCHER_H
+
+#include "weapon.h"
+
+#define ACID_LAUNCHER_MAXRANGE = 50.0;
+
+class AcidLauncher : public Weapon
+  {
+  ObjectListDeclaration(AcidLauncher);
+  public:
+    AcidLauncher ();
+    AcidLauncher(const TiXmlElement* root);
+    virtual ~AcidLauncher ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+
+  private:
+  };
+
+#endif /* _ACID_LAUNCHER_H */
Index: trunk/src/world_entities/weapons/heavy_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/heavy_blaster.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/heavy_blaster.cc	(revision 10368)
@@ -0,0 +1,262 @@
+#include "heavy_blaster.h"
+#include "world_entities/projectiles/projectile.h"
+
+#include "world_entity.h"
+#include "static_model.h"
+#include "weapon_manager.h"
+#include "util/loading/factory.h"
+
+#include "animation3d.h"
+
+#include "loading/fast_factory.h"
+
+CREATE_FACTORY(HeavyBlaster);
+/**
+ * Standard constructor
+ */
+HeavyBlaster::HeavyBlaster (int leftRight)
+ : Weapon()
+{
+    this->init(leftRight);
+}
+
+HeavyBlaster::HeavyBlaster (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+    // TODO add leftRight to params
+    this->init(0);
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+HeavyBlaster::~HeavyBlaster()
+{
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+   delete [] this->shootAnim[i];
+   delete [] this->objComp[i];
+  }
+  delete [] this->emissionPoint;
+  
+   delete [] this->shootAnim;
+   delete [] this->objComp;
+/*
+    for(int j = 0; j < this->getSegs(); j++)
+    {
+      delete this->shootAnim[i][j];
+      delete this->objComp[i][j];
+    }
+    delete this->shootAnim[i];
+    delete this->objComp[i];
+    delete this->emissionPoint[i];
+  }*/
+
+//  this->deconstr();
+     // model will be deleted from WorldEntity-destructor
+}
+
+void HeavyBlaster::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void HeavyBlaster::init(int leftRight)
+{
+
+  this->leftRight = leftRight;
+  //this->registerObject(this, HeavyBlaster::_objectList);
+
+//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
+
+  this->loadModel("models/guns/fragcannon.obj", .4);
+  
+
+  this->setStateDuration(WS_SHOOTING, 0.5);   // 2 Schuss pro Sekunde
+  this->setStateDuration(WS_RELOADING, 0);
+  this->setStateDuration(WS_ACTIVATING, .5);
+  this->setStateDuration(WS_DEACTIVATING, 1);
+
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
+  //this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sound/laser.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav");
+  this->setActionSound(WA_RELOAD, "sound/spawn/alien_generator.wav");
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("HBolt");   // FIXME temp project type until the blaste class exist
+//   this->setProjectileTypeC("SpikeBall");   // FIXME temp project type until the blaste class exist
+  this->prepareProjectiles(5);
+
+  this->setBarrels(3);
+  this->setSegs(2);
+  this->activeBarrel = 0;
+//   this->init2();
+
+
+
+  this->objComp = new PNode**[this->getBarrels()];
+  this->emissionPoint = new PNode*[this->getBarrels()];
+  this->shootAnim = new Animation3D**[this->getBarrels()];
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+    this->objComp[i] = new PNode* [this->getSegs()];
+    this->emissionPoint[i] = new PNode;
+    this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
+    this->emissionPoint[i]->setName("EmissionPoint");
+    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+    this->shootAnim[i] = new Animation3D* [this->getSegs()];
+    for(int j = 0; j < this->getSegs(); j++)
+    {
+      this->objComp[i][j] = new PNode;
+      this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
+      this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
+    }
+  }
+
+  if (this->leftRight == W_RIGHT)
+  {
+    this->emissionPoint[0]->setRelCoor(Vector(1.1, 0.14, 0.06));
+    this->emissionPoint[1]->setRelCoor(Vector(1.1, -.06, 0.14));
+    this->emissionPoint[2]->setRelCoor(Vector(1.1, 0.06, -.14));
+  }
+  else {
+    this->emissionPoint[0]->setRelCoor(Vector(1.1, 0.14, -.06));
+    this->emissionPoint[1]->setRelCoor(Vector(1.1, -.06, -.14));
+    this->emissionPoint[2]->setRelCoor(Vector(1.1, 0.06, 0.14));
+  }
+
+
+//   Animation3D* animB0Shoot = this->getAnimation(WS_SHOOTING0, this->objComp[0][0]);
+//   Animation3D* animB1Shoot = this->getAnimation(WS_SHOOTING1, this->objComp2);
+//   Animation3D* animB2Shoot = this->getAnimation(WS_SHOOTING2, this->objComp3);
+//   Animation3D* animT0Shoot = this->getAnimation(WS_SHOOTING3, this->objComp[0][1]);
+//   Animation3D* animT1Shoot = this->getAnimation(WS_SHOOTING4, this->objComp5);
+//   Animation3D* animT2Shoot = this->getAnimation(WS_SHOOTING5, this->objComp6);
+
+
+//   this->shootAnim[0][0]->setInfinity(ANIM_INF_CONSTANT);
+//   animB1Shoot->setInfinity(ANIM_INF_CONSTANT);
+//   animB2Shoot->setInfinity(ANIM_INF_CONSTANT);
+//   animT0Shoot->setInfinity(ANIM_INF_CONSTANT);
+//   animT1Shoot->setInfinity(ANIM_INF_CONSTANT);
+//   animT2Shoot->setInfinity(ANIM_INF_CONSTANT);
+
+  for (int i = 0; i < this->getBarrels(); i++){
+    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.05, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(-0.3, 0.0, 0.0), Quaternion(), 0.9, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.55, ANIM_LINEAR, ANIM_NULL);
+
+    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.05, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][1]->addKeyFrame(Vector(-0.4, 0.0, 0.0), Quaternion(), 1.2, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.25, ANIM_LINEAR, ANIM_NULL);
+  }
+
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+  animation3->setInfinity(ANIM_INF_CONSTANT);
+
+//   this->setEmissionPoint(3.8, 1.2, 0, 0);
+
+  animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+  animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+
+  animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+  animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+}
+
+
+void HeavyBlaster::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
+  pj->setParent(PNode::getNullParent());
+
+//   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5));
+//   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*130 + VECTOR_RAND(1));
+  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*130 + VECTOR_RAND(1));
+
+  pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
+//   pj->setAbsCoor(this->getEmissionPoint(0));
+  pj->setAbsDir(this->getAbsDir());
+//   pj->toList(OM_GROUP_01_PROJ);
+  pj->activate();
+
+  // initiate animation
+  for (int i = 0; i < this->getSegs(); i++)
+    this->shootAnim[this->activeBarrel][i]->replay();
+
+  // switch barrel
+  this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
+}
+
+/**
+ *  this activates the weapon
+*/
+void HeavyBlaster::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void HeavyBlaster::deactivate()
+{
+}
+
+
+void HeavyBlaster::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+
+  if (this->leftRight == W_LEFT)
+    glScalef(1.0, 1.0, -1.0);
+
+  static_cast<StaticModel*>(this->getModel())->draw(6);
+
+  glPushMatrix();
+    glTranslatef (this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(1);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[1][0]->getAbsCoor().x, this->objComp[1][0]->getAbsCoor().y, this->objComp[1][0]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(2);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[2][0]->getAbsCoor().x, this->objComp[2][0]->getAbsCoor().y, this->objComp[2][0]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(0);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[0][1]->getAbsCoor().x, this->objComp[0][1]->getAbsCoor().y, this->objComp[0][1]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(4);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[1][1]->getAbsCoor().x, this->objComp[1][1]->getAbsCoor().y, this->objComp[1][1]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(5);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[2][1]->getAbsCoor().x, this->objComp[2][1]->getAbsCoor().y, this->objComp[2][1]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(3);
+  glPopMatrix();
+
+  glPopMatrix();
+}
Index: trunk/src/world_entities/weapons/heavy_blaster.h
===================================================================
--- trunk/src/world_entities/weapons/heavy_blaster.h	(revision 10368)
+++ trunk/src/world_entities/weapons/heavy_blaster.h	(revision 10368)
@@ -0,0 +1,43 @@
+#ifndef HEAVY_BLASTER_H
+#define HEAVY_BLASTER_H
+
+
+#include "weapon.h"
+
+#define    W_LEFT        0
+#define    W_RIGHT       1
+
+/**
+ *	@author Marc Schaerer <marcscha@ee.ethz.ch>
+ *  
+ *  Heavy Blaster class
+ */
+class HeavyBlaster : public Weapon
+{
+  //ObjectListDeclaration(HeavyBlaster);
+  public:
+    HeavyBlaster(int leftRight);
+    HeavyBlaster (const TiXmlElement* root);
+    virtual ~HeavyBlaster();
+
+    void init(int leftRight);
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+    PNode** emissionPoint;
+
+    int activeBarrel;
+
+    int leftRight;
+};
+
+#endif
Index: trunk/src/world_entities/weapons/light_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/light_blaster.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/light_blaster.cc	(revision 10368)
@@ -0,0 +1,189 @@
+#include "light_blaster.h"
+#include "world_entities/projectiles/projectile.h"
+
+#include "world_entity.h"
+#include "static_model.h"
+#include "weapon_manager.h"
+#include "util/loading/factory.h"
+
+#include "animation3d.h"
+
+#include "loading/fast_factory.h"
+
+CREATE_FACTORY(LightBlaster);
+/**
+ * Standard constructor
+ */
+LightBlaster::LightBlaster ()
+ : Weapon()
+{
+    this->init();
+}
+
+LightBlaster::LightBlaster (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+    this->init();
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+LightBlaster::~LightBlaster()
+{
+
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+   delete [] this->shootAnim[i];
+   delete [] this->objComp[i];
+  }
+  delete [] this->emissionPoint;
+   delete [] this->shootAnim;
+   delete [] this->objComp;
+/*
+    for(int j = 0; j < this->getSegs(); j++)
+    {
+      delete this->shootAnim[i][j];
+      delete this->objComp[i][j];
+    }
+    delete this->shootAnim[i];
+    delete this->objComp[i];
+    delete this->emissionPoint[i];
+  }*/
+
+//  this->deconstr();
+      // model will be deleted from WorldEntity-destructor
+}
+
+void LightBlaster::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void LightBlaster::init()
+{
+
+  this->loadModel("models/guns/gattling.obj", 0.333);
+  
+
+  this->setStateDuration(WS_SHOOTING, 0.05);  // 20 Schuss pro Sekunde
+  this->setStateDuration(WS_RELOADING, 0);
+  this->setStateDuration(WS_ACTIVATING, .5);
+  this->setStateDuration(WS_DEACTIVATING, 1);
+
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
+  //this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sound/laser.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav");
+  this->setActionSound(WA_RELOAD, "sound/spawn/alien_generator.wav");
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  //this->setProjectileTypeC("RailProjectile");   // FIXME temp project type until the blaste class exist
+  this->setProjectileTypeC("LBolt");   // Working; FIXME: add textures
+//   this->setProjectileTypeC("Spike");   // Working; FIXME: add textures
+  this->prepareProjectiles(100);
+
+  this->setBarrels(3);
+  this->setSegs(1);
+  this->activeBarrel = 0;
+
+  this->objComp = new PNode**[this->getBarrels()];
+  this->emissionPoint = new PNode*[this->getBarrels()];
+  this->shootAnim = new Animation3D**[this->getBarrels()];
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+    this->objComp[i] = new PNode* [this->getSegs()];
+    this->emissionPoint[i] = new PNode;
+    this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
+    this->emissionPoint[i]->setName("EmissionPoint");
+    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+    this->shootAnim[i] = new Animation3D* [this->getSegs()];
+    for(int j = 0; j < this->getSegs(); j++)
+    {
+      this->objComp[i][j] = new PNode;
+      this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
+      this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
+    }
+  }
+
+  for (int i = 0; i < this->getBarrels(); i++ )
+    this->emissionPoint[i]->setRelCoor(Vector(1.19, 0.0, 0.1));
+
+//   Animation3D* animation1 = this->getAnimation(WS_SHOOTING, this);
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+//   animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+  animation3->setInfinity(ANIM_INF_CONSTANT);
+
+//   this->setEmissionPoint(3.8, 1.2, 0);
+
+  for (int i = 0; i < this->getBarrels(); i++){
+    this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion(i * 120, Vector(1.0, 0.0, 0.0)), 0.049, ANIM_NULL, ANIM_LINEAR);
+    this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion((i+1)*120, Vector(1.0, 0.0, 0.0)), 0.001, ANIM_NULL, ANIM_LINEAR);
+  }
+
+
+  animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+  animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+
+  animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+  animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+}
+
+
+void LightBlaster::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
+
+  pj->setParent(PNode::getNullParent());
+
+//   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5));
+  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*180);
+
+  pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
+  pj->setAbsDir(this->getAbsDir());
+//   pj->toList(OM_GROUP_01_PROJ);
+  pj->activate();
+
+  for (int i = 0; i < this->getSegs(); i++)
+    this->shootAnim[this->activeBarrel][i]->replay();
+
+  // switch barrel
+  this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
+}
+
+/**
+ *  this activates the weapon
+*/
+void LightBlaster::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void LightBlaster::deactivate()
+{
+}
+
+void LightBlaster::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+    glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+    Vector tmpRot = this->getAbsDir().getSpacialAxis();
+    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+    static_cast<StaticModel*>(this->getModel())->draw();
+  glPopMatrix();
+}
Index: trunk/src/world_entities/weapons/light_blaster.h
===================================================================
--- trunk/src/world_entities/weapons/light_blaster.h	(revision 10368)
+++ trunk/src/world_entities/weapons/light_blaster.h	(revision 10368)
@@ -0,0 +1,39 @@
+#ifndef LIGHT_BLASTER_H
+#define LIGHT_BLASTER_H
+
+
+#include "weapon.h"
+
+/**
+ *	@author Marc Schaerer <marcscha@ee.ethz.ch>
+ *  
+ *  Light Blaster class
+ */
+class LightBlaster : public Weapon
+{
+  //ObjectListDeclaration(LightBlaster);
+  public:
+    LightBlaster ();
+    LightBlaster (const TiXmlElement* root);
+    virtual ~LightBlaster();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+
+    PNode** emissionPoint;
+
+    int activeBarrel;
+};
+
+#endif
Index: trunk/src/world_entities/weapons/medium_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/medium_blaster.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/medium_blaster.cc	(revision 10368)
@@ -0,0 +1,173 @@
+#include "medium_blaster.h"
+#include "world_entities/projectiles/projectile.h"
+
+#include "world_entity.h"
+#include "static_model.h"
+#include "weapon_manager.h"
+#include "util/loading/factory.h"
+
+#include "animation3d.h"
+
+#include "loading/fast_factory.h"
+
+//
+//ObjectListDefinition(MediumBlaster);
+CREATE_FACTORY(MediumBlaster);
+/**
+ * Standard constructor
+ */
+MediumBlaster::MediumBlaster ()
+ : Weapon()
+{
+    this->init();
+}
+
+MediumBlaster::MediumBlaster (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+    this->init();
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+MediumBlaster::~MediumBlaster()
+{
+      // model will be deleted from WorldEntity-destructor
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+   delete [] this->shootAnim[i];
+  }
+  delete [] this->shootAnim;
+}
+
+void MediumBlaster::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void MediumBlaster::init()
+{
+  this->loadModel("models/guns/blaster.obj", .33);
+
+  this->setStateDuration(WS_SHOOTING, 0.2);   // 5 Schuss pro Sekunde
+
+  this->setStateDuration(WS_RELOADING, 0);
+  this->setStateDuration(WS_ACTIVATING, .5); //.5);
+  this->setStateDuration(WS_DEACTIVATING, 1); // 1);
+
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
+  //this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sound/laser.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav");
+  this->setActionSound(WA_RELOAD, "sound/spawn/alien_generator.wav");
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("MBolt");   // FIXME temp project type until the blaste class exist
+  this->prepareProjectiles(100);
+
+
+  this->setBarrels(1);
+  this->setSegs(2);
+  this->activeBarrel = 0;
+
+  this->objComp = new PNode**[this->getBarrels()];
+  this->shootAnim = new Animation3D**[this->getBarrels()];
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+    this->objComp[i] = new PNode* [this->getSegs()];
+    this->shootAnim[i] = new Animation3D* [this->getSegs()];
+    for(int j = 0; j < this->getSegs(); j++)
+    {
+      this->objComp[i][j] = new PNode;
+      this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
+      this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
+    }
+  }
+
+  for (int i = 0; i < this->getBarrels(); i++){
+    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(-0.333, 0.0, 0.0), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);
+
+    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][1]->addKeyFrame(Vector(.166, 0.0, 0.0), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);
+  }
+
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+  animation3->setInfinity(ANIM_INF_CONSTANT);
+
+
+  this->setEmissionPoint(1.3, 0, 0);
+
+  animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+  animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+
+  animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+  animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+}
+
+
+void MediumBlaster::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
+
+  pj->setParent(PNode::getNullParent());
+
+  pj->setVelocity(this->getParent()->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*160);
+
+  pj->setAbsCoor(this->getEmissionPoint());
+  pj->setAbsDir(this->getAbsDir());
+  pj->activate();
+
+  for (int i = 0; i < this->getSegs(); i++)
+    this->shootAnim[this->activeBarrel][i]->replay();
+}
+
+/**
+ *  this activates the weapon
+*/
+void MediumBlaster::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void MediumBlaster::deactivate()
+{
+}
+
+void MediumBlaster::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+
+  static_cast<StaticModel*>(this->getModel())->draw(2);
+
+  glPushMatrix();
+    glTranslatef (this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(1);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[0][1]->getAbsCoor().x, this->objComp[0][1]->getAbsCoor().y, this->objComp[0][1]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(0);
+  glPopMatrix();
+
+  glPopMatrix();
+}
Index: trunk/src/world_entities/weapons/medium_blaster.h
===================================================================
--- trunk/src/world_entities/weapons/medium_blaster.h	(revision 10368)
+++ trunk/src/world_entities/weapons/medium_blaster.h	(revision 10368)
@@ -0,0 +1,38 @@
+#ifndef MEDIUM_BLASTER_H
+#define MEDIUM_BLASTER_H
+
+
+#include "weapon.h"
+
+/**
+ *	@author Marc Schaerer <marcscha@ee.ethz.ch>
+ *  
+ *  Medium Blaster class
+ */
+class MediumBlaster : public Weapon
+{
+  //ObjectListDeclaration(MediumBlaster);
+  public:
+    MediumBlaster();
+    MediumBlaster (const TiXmlElement* root);
+    virtual ~MediumBlaster();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+
+    int activeBarrel;
+
+};
+
+#endif
Index: trunk/src/world_entities/weapons/spike_launcher.cc
===================================================================
--- trunk/src/world_entities/weapons/spike_launcher.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/spike_launcher.cc	(revision 10368)
@@ -0,0 +1,259 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer
+   co-programmer:
+*/
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "spike_launcher.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/projectile.h"
+#include "world_entities/projectiles/spike_ball.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include <list>
+#include <iterator>
+#include "util/state.h"
+
+#include "math/quaternion.h"
+
+#include "util/loading/factory.h"
+
+
+
+using namespace std;
+
+ObjectListDefinition(SpikeLauncher);
+CREATE_FACTORY(SpikeLauncher);
+
+/**
+ *  standard constructor
+ *
+ * creates a new SpikeLauncher
+ */
+SpikeLauncher::SpikeLauncher()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new SpikeLauncher from a TiXmlElement
+ */
+SpikeLauncher::SpikeLauncher(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+SpikeLauncher::~SpikeLauncher ()
+{
+  delete this->launcher;
+
+  // model will be deleted from WorldEntity-destructor
+}
+
+void SpikeLauncher::init()
+{
+  this->registerObject(this, SpikeLauncher::_objectList);
+
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+
+  this->setStateDuration(WS_SHOOTING, .6);
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(10);
+  this->increaseEnergy(10);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("Spike");
+
+//   this->loadModel("models/guns/turret1.obj", 1.0);
+  this->size = 2.5;
+
+  this->setEmissionPoint(0.0, 0.0, 0.0);
+
+
+  this->spikes = 26;
+  this->launcher = new Vector [this->spikes];
+
+  this->getProjectileFactory()->prepare(this->spikes);  //we don't need more...
+
+//   this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
+//   this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+//   this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void SpikeLauncher::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void SpikeLauncher::activate()
+{
+  this->launcher[0] = Vector(1.0, 0.0, 0.0);
+  this->launcher[1] = Vector(0.0, 1.0, 0.0);
+  this->launcher[2] = Vector(0.0, 0.0, 1.0);
+
+  this->launcher[3] = Vector(1.0, 1.0, 0.0);
+  this->launcher[4] = Vector(0.0, 1.0, 1.0);
+  this->launcher[5] = Vector(1.0, 0.0, 1.0);
+  this->launcher[6] = Vector(1.0, -1.0, 0.0);
+  this->launcher[7] = Vector(0.0, 1.0, -1.0);
+  this->launcher[8] = Vector(-1.0, 0.0, 1.0);
+
+  this->launcher[9] = Vector(-1.0, 1.0, 1.0);
+  this->launcher[10] = Vector(1.0, 1.0, 1.0);
+  this->launcher[11] = Vector(1.0, -1.0, 1.0);
+  this->launcher[12] = Vector(-1.0, -1.0, 1.0);
+
+  int tmp = this->spikes / 2;
+  for (int i = 0; i < tmp; i++)
+  {
+    this->launcher[i].normalize();
+    this->launcher[tmp + i] =  this->launcher[i] * (-1);
+  }
+}
+
+void SpikeLauncher::deactivate()
+{
+}
+
+void SpikeLauncher::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+}
+
+void SpikeLauncher::updateFireDir(Vector v, float angle){
+
+  float** m = new float* [3];
+  for( int i = 0; i < 3 ; i++)
+    m[i] = new float;
+
+  float nx, ny, nz, ca, sa;
+
+  nx = v.x;
+  ny = v.y;
+  nz = v.z;
+
+  ca = cos (angle);
+  sa = sin (angle);
+// final version below... easier to to cheat with the one above.
+/*
+  nx = this->getParent()->getRotationVector().x;
+  ny = this->getParent()->getRotationVector().y;
+  nz = this->getParent()->getRotationVector().z;
+
+  ca = cos (this->getParent()->getAngle());
+  sa = sin (this->getParent()->getAngle());*/
+/*
+  float * m = new float [9];
+  m[0] = 1.0f+(1.0f-ca)*(nx*nx-1.0f);
+  m[1] = -nz*sa+(1.0f-ca)*nx*ny;
+  m[2] = ny*sa+(1.0f-ca)*nx*nz;
+  m[3] = nz*sa+(1.0f-ca)*nx*ny;
+  m[4] = 1.0f+(1.0f-ca)*(ny*ny-1.0f);
+  m[5] = -nx*sa+(1.0f-ca)*ny*nz;
+  m[6] = -ny*sa+(1.0f-ca)*nx*nz;
+  m[7] = nx*sa+(1.0f-ca)*ny*nz;
+  m[8] = 1.0f+(1.0f-ca)*(nz*nz-1.0f);*/
+
+  m[0][0] = nx * nx * (1 - ca) + ca;
+  m[0][1] = nx * ny * (1 - ca) + nz * sa;
+  m[0][2] = nx * nz * (1 - ca) - ny * sa;
+  m[1][0] = nx * nz * (1 - ca) - nz * sa;
+  m[1][1] = ny * ny * (1 - ca) + ca;
+  m[1][2] = ny * nz * (1 - ca) + nx * sa;
+  m[2][0] = nx * nz * (1 - ca) + ny * sa;
+  m[2][1] = ny * nz * (1 - ca) - nx * sa;
+  m[2][2] = nz * nz * (1 - ca) + ca;
+
+  float x, y, z;
+  for (int i = 0; i < this->spikes;i++){
+    printf("%i ", i);
+    x = m[0][0] * this->launcher[i].x + m[0][1] * this->launcher[i].y + m[0][2] * this->launcher[i].z;
+    y = m[1][0] * this->launcher[i].x + m[1][1] * this->launcher[i].y + m[1][2] * this->launcher[i].z;
+    z = m[2][0] * this->launcher[i].x + m[2][1] * this->launcher[i].y + m[2][2] * this->launcher[i].z;
+/*
+    x = this->launcher[i].x * m[0] + this->launcher[i].y * m[1] + this->launcher[i].z * m[2];
+    y = this->launcher[i].x * m[3] + this->launcher[i].y * m[4] + this->launcher[i].z * m[5];
+    z = this->launcher[i].x * m[6] + this->launcher[i].y * m[7] + this->launcher[i].z * m[8];*/
+    this->launcher[i] = Vector (x, y, z);
+  }
+  printf("\n");
+
+  for( int i = 0; i < 3 ; i++)
+    delete m[i];
+  delete m;
+}
+
+
+void SpikeLauncher::fire()
+{
+  updateFireDir(VECTOR_RAND(1), 20);
+
+  Projectile* pj = NULL;
+  for (int i = 0; i < this->spikes; i++)
+  {
+    pj  = this->getProjectile();
+    if (pj == NULL) // if true, we do have a problem!!
+      return;
+
+    pj->setVelocity(this->launcher[i].getNormalized() * 300.0);
+
+    pj->setParent(PNode::getNullParent());
+    pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size);
+    Quaternion q;
+    pj->setRelDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1)));
+
+    pj->activate();
+  }
+}
Index: trunk/src/world_entities/weapons/spike_launcher.h
===================================================================
--- trunk/src/world_entities/weapons/spike_launcher.h	(revision 10368)
+++ trunk/src/world_entities/weapons/spike_launcher.h	(revision 10368)
@@ -0,0 +1,39 @@
+/*!
+ * @file spike_launcher.h
+*/
+
+
+#ifndef _SPIKE_LAUNCHER_H
+#define _SPIKE_LAUNCHER_H
+
+#include "weapon.h"
+
+#define SPIKE_LAUNCHER_MAXRANGE = 500.0;
+
+class SpikeLauncher : public Weapon
+  {
+  ObjectListDeclaration(SpikeLauncher);
+  public:
+    SpikeLauncher ();
+    SpikeLauncher(const TiXmlElement* root);
+    virtual ~SpikeLauncher ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+    virtual void updateFireDir(Vector t, float angle);
+
+  private:
+
+  int           spikes;
+  Vector*       launcher;
+  float         size;
+  };
+
+#endif /* _SPIKE_LAUNCHER_H */
Index: trunk/src/world_entities/weapons/spike_thrower.cc
===================================================================
--- trunk/src/world_entities/weapons/spike_thrower.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/spike_thrower.cc	(revision 10368)
@@ -0,0 +1,166 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer
+   co-programmer:
+*/
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "spike_thrower.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/projectile.h"
+#include "world_entities/projectiles/spike_ball.h"
+#include "world_entities/projectiles/spike.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include <list>
+#include <iterator>
+#include "util/state.h"
+
+#include "math/quaternion.h"
+
+#include "util/loading/factory.h"
+
+
+
+using namespace std;
+
+ObjectListDefinition(SpikeThrower);
+CREATE_FACTORY(SpikeThrower);
+
+/**
+ *  standard constructor
+ *
+ * creates a new SpikeThrower
+ */
+SpikeThrower::SpikeThrower()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new SpikeThrower from a TiXmlElement
+ */
+SpikeThrower::SpikeThrower(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+SpikeThrower::~SpikeThrower ()
+{
+
+  // model will be deleted from WorldEntity-destructor
+}
+
+void SpikeThrower::init()
+{
+  this->registerObject(this, SpikeThrower::_objectList);
+/*
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);*/
+
+  this->setStateDuration(WS_SHOOTING, .6);
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(10);
+  this->increaseEnergy(10);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("SpikeBall");
+
+//   this->loadModel("models/guns/turret1.obj", 1.0);
+
+  this->setEmissionPoint(2, 0, 0);
+  this->getProjectileFactory()->prepare(50);
+
+  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void SpikeThrower::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void SpikeThrower::activate()
+{
+}
+
+void SpikeThrower::deactivate()
+{
+}
+
+void SpikeThrower::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+}
+
+void SpikeThrower::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
+
+  pj->setParent(PNode::getNullParent());
+
+  dynamic_cast<SpikeBall*>(pj)->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*110);
+
+  pj->setAbsCoor(this->getEmissionPoint());
+  pj->setAbsDir(this->getAbsDir());
+  pj->activate();
+
+//   this->increaseEnergy( - this->getProjectile()->getMinEnergy());
+
+}
Index: trunk/src/world_entities/weapons/spike_thrower.h
===================================================================
--- trunk/src/world_entities/weapons/spike_thrower.h	(revision 10368)
+++ trunk/src/world_entities/weapons/spike_thrower.h	(revision 10368)
@@ -0,0 +1,34 @@
+/*!
+ * @file spike_thrower.h
+*/
+
+
+#ifndef _SPIKE_THROWER_H
+#define _SPIKE_THROWER_H
+
+#include "weapon.h"
+
+#define SPIKE_THROWER_MAXRANGE = 500.0;
+
+class SpikeThrower : public Weapon
+  {
+  ObjectListDeclaration(SpikeThrower);
+  public:
+    SpikeThrower ();
+    SpikeThrower(const TiXmlElement* root);
+    virtual ~SpikeThrower ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+
+  private:
+  };
+
+#endif /* _SPIKE_THROWER_H */
Index: trunk/src/world_entities/weapons/swarm_launcher.cc
===================================================================
--- trunk/src/world_entities/weapons/swarm_launcher.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/swarm_launcher.cc	(revision 10368)
@@ -0,0 +1,171 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer
+   co-programmer:
+*/
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "swarm_launcher.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/projectile.h"
+#include "world_entities/projectiles/swarm_projectile.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include <list>
+#include <iterator>
+#include "util/state.h"
+
+#include "math/quaternion.h"
+
+#include "util/loading/factory.h"
+
+
+
+using namespace std;
+
+ObjectListDefinition(SwarmLauncher);
+CREATE_FACTORY(SwarmLauncher);
+
+/**
+ *  standard constructor
+ *
+ * creates a new SwarmLauncher
+ */
+SwarmLauncher::SwarmLauncher()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new SwarmLauncher from a TiXmlElement
+ */
+SwarmLauncher::SwarmLauncher(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+SwarmLauncher::~SwarmLauncher ()
+{
+  // model will be deleted from WorldEntity-destructor
+}
+
+void SwarmLauncher::init()
+{
+  this->registerObject(this, SwarmLauncher::_objectList);
+
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+
+  this->setStateDuration(WS_SHOOTING, .6);
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(10);
+  this->increaseEnergy(10);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("SwarmProjectile");
+
+  this->loadModel("models/guns/turret1.obj", 1.0);
+
+  this->setEmissionPoint(1.684, 0.472, 0);
+  this->getProjectileFactory()->prepare(50);
+
+  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void SwarmLauncher::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void SwarmLauncher::activate()
+{
+}
+
+void SwarmLauncher::deactivate()
+{
+}
+
+void SwarmLauncher::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+}
+
+void SwarmLauncher::fire()
+{
+  bool fired  = false;
+
+  Projectile* pj = NULL;
+  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
+  {
+    if( ((*eIterator)->getOMListNumber() != (this->getOMListNumber() -1)) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300)
+    {
+      pj  = this->getProjectile();
+      if (pj == NULL)
+        return;
+
+      fired = true;
+      pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10)));
+
+      pj->setParent(PNode::getNullParent());
+      pj->setAbsCoor(this->getEmissionPoint());
+      pj->setAbsDir(this->getAbsDir());
+      dynamic_cast<SwarmProjectile*>(pj)->setTarget( (PNode*)(*eIterator) );
+      //pj->toList(OM_GROUP_01_PROJ);
+      pj->activate();
+    }
+  }
+  if( !fired)
+    this->increaseEnergy( this->getProjectile()->getMinEnergy());
+}
Index: trunk/src/world_entities/weapons/swarm_launcher.h
===================================================================
--- trunk/src/world_entities/weapons/swarm_launcher.h	(revision 10368)
+++ trunk/src/world_entities/weapons/swarm_launcher.h	(revision 10368)
@@ -0,0 +1,34 @@
+/*!
+ * @file swarm_launcher.h
+*/
+
+
+#ifndef _SWARM_LAUNCHER_H
+#define _SWARM_LAUNCHER_H
+
+#include "weapon.h"
+
+#define SWARM_LAUNCHER_MAXRANGE = 500.0;
+
+class SwarmLauncher : public Weapon
+  {
+  ObjectListDeclaration(SwarmLauncher);
+  public:
+    SwarmLauncher ();
+    SwarmLauncher(const TiXmlElement* root);
+    virtual ~SwarmLauncher ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+
+  private:
+  };
+
+#endif /* _SWARM_LAUNCHER_H */
Index: trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon.cc	(revision 10351)
+++ trunk/src/world_entities/weapons/weapon.cc	(revision 10368)
@@ -33,5 +33,5 @@
 #include "resource_sound_buffer.h"
 
-#include "elements/glgui_energywidget.h"
+#include "elements/glgui_energywidgetvertical.h"
 
 ObjectListDefinition(Weapon);
@@ -119,8 +119,20 @@
   }
 
-  this->soundSource = new OrxSound::SoundSource(this);       //< Every Weapon has exacty one SoundSource.
-  this->emissionPoint.setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
-  this->emissionPoint.setName("EmissionPoint");
-  this->emissionPoint.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->soundSource = new OrxSound::SoundSource(this);       //< Every Weapon has exacty one SoundSource
+
+  this->barrels = 1;
+  this->segs = 1;
+
+  this->shootAnim = new Animation3D**[this->getBarrels()];
+  for (int i = 0; i < this->getBarrels(); i++)
+    this->shootAnim[i] = new Animation3D* [this->getSegs()];
+
+  this->emissionPoint = new PNode*[this->barrels];
+  for(int i = 0; i < this->barrels; i++){
+    this->emissionPoint[i] = new PNode;
+    this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
+    this->emissionPoint[i]->setName("EmissionPoint");
+    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  }
 
   this->defaultTarget = NULL;                      //< Nothing is Targeted by default.
@@ -145,4 +157,44 @@
 
 /**
+ * needed, if there are more than one barrel or segments
+ */
+void Weapon::init2() 
+{
+  if (this->barrels == 1 && this->segs == 1)
+    return;
+
+  delete this->emissionPoint[0];
+  delete this->emissionPoint;
+  delete this->shootAnim[0];
+  delete this->shootAnim;
+
+  this->shootAnim = new Animation3D**[this->barrels];
+  this->emissionPoint = new PNode*[this->barrels];
+  for(int i = 0; i < this->barrels; i++){
+    this->emissionPoint[i] = new PNode;
+    this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
+    this->emissionPoint[i]->setName("EmissionPoint");
+    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+    this->shootAnim[i] = new Animation3D* [this->segs];
+  }
+}
+
+/**
+ * deconstructor for init2
+ */
+void Weapon::deconstr()
+{
+  for(int i = 0; i < this->barrels; i++) {
+    delete this->emissionPoint[i];
+    for (int j = 0; j < this->segs; j++)
+      delete this->shootAnim[i][j];
+    delete this->shootAnim[i];
+  }
+
+  delete this->emissionPoint;
+  delete this->shootAnim;
+}
+
+/**
  * loads the Parameters of a Weapon
  * @param root the XML-Element to load the Weapons settings from
@@ -154,7 +206,7 @@
   LoadParam(root, "projectile", this, Weapon, setProjectileTypeC)
   .describe("Sets the name of the Projectile to load onto the Entity");
-
+/*
   LoadParam(root, "emission-point", this, Weapon, setEmissionPoint)
-  .describe("Sets the Point of emission of this weapon");
+  .describe("Sets the Point of emission of this weapon (1: EmmsionVector; 2: EmissionPoint)");*/
 
   LoadParam(root, "state-duration", this, Weapon, setStateDuration)
@@ -253,9 +305,13 @@
  * @param point the Point relative to the mass-point of the Weapon
  */
+void Weapon::setEmissionPoint(const Vector& point, int barrel)
+{
+  this->emissionPoint[barrel]->setRelCoor(point);
+}
+
 void Weapon::setEmissionPoint(const Vector& point)
 {
-  this->emissionPoint.setRelCoor(point);
-}
-
+  this->emissionPoint[0]->setRelCoor(point);
+}
 
 /**
@@ -315,10 +371,29 @@
 }
 
+Animation3D* Weapon::getAnimation(int barrel, int seg, PNode* node)
+{
+  if (barrel >= this->getBarrels() || seg >= this->getSegs()) // if the state is not known
+    return NULL;
+
+  if (unlikely(this->shootAnim[barrel][seg] == NULL)) // if the animation does not exist yet create it.
+  {
+    if (likely(node != NULL))
+      return this->shootAnim[barrel][seg] = new Animation3D(node);
+    else
+    {
+//       PRINTF(2)("Node not defined for the Creation of the 3D-animation of state %s\n", stateToChar(state));
+      return NULL;
+    }
+  }
+  else
+    return this->shootAnim[barrel][seg];
+}
+
 OrxGui::GLGuiWidget* Weapon::getEnergyWidget()
 {
-  if (this->energyWidget == NULL)
-  {
-    this->energyWidget = new OrxGui::GLGuiEnergyWidget();
-    this->energyWidget->setDisplayedName(this->getClassCName());
+  if ( this->energyWidget == NULL)
+  {
+    this->energyWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    //this->energyWidget->setDisplayedName(this->getClassCName());
     this->energyWidget->setSize2D( 20, 100);
     this->energyWidget->setMaximum(this->getEnergyMax());
@@ -352,4 +427,5 @@
   if (likely(this->isActive()))
   {
+    /** Disabled for releaseFire() from WM*/
     if (this->requestedAction != WA_NONE)
       return;
@@ -378,4 +454,5 @@
   {
     this->energy += energyToAdd;
+    this->updateWidgets();
     return 0.0;
   }
@@ -383,6 +460,8 @@
   {
     this->energy += maxAddEnergy;
+    this->updateWidgets();
     return energyToAdd - maxAddEnergy;
   }
+  
 }
 
@@ -431,5 +510,5 @@
     break;
     default:
-    PRINTF(2)("Action %s Not Implemented yet \n", Weapon::actionToChar(action));
+    PRINTF(5)("Action %s Not Implemented yet \n", Weapon::actionToChar(action));
     return false;
   }
@@ -507,4 +586,5 @@
 bool Weapon::fireW()
 {
+//   printf("fireW Weapon\n");
   //if (likely(this->currentState != WS_INACTIVE))
   if (this->minCharge <= this->energy)
@@ -513,5 +593,4 @@
     if (this->soundBuffers[WA_SHOOT].loaded())
       this->soundSource->play(this->soundBuffers[WA_SHOOT]);
-    this->updateWidgets();
     // fire
     this->energy -= this->minCharge;
@@ -519,4 +598,5 @@
     // setting up for the next state
     this->enterState(WS_SHOOTING);
+    this->updateWidgets();
   }
   else  // reload if we still have the charge
@@ -538,5 +618,5 @@
       unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge))
   {
-    this->requestAction(WA_DEACTIVATE);
+    //this->requestAction(WA_DEACTIVATE);
     this->execute();
     return false;
Index: trunk/src/world_entities/weapons/weapon.h
===================================================================
--- trunk/src/world_entities/weapons/weapon.h	(revision 10351)
+++ trunk/src/world_entities/weapons/weapon.h	(revision 10368)
@@ -126,9 +126,14 @@
 
     // EMISSION
+    /** keeping old functions*/
+    void setEmissionPoint(const Vector& point, int barrel);
     void setEmissionPoint(const Vector& point);
     /** @see void setEmissionPoint(const Vector& point); */
+    inline void setEmissionPoint(float x, float y, float z, int barrel) { this->setEmissionPoint(Vector(x, y, z), barrel); };
     inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x, y, z)); };
     /** @returns the absolute Position of the EmissionPoint */
-    inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); };
+    inline const Vector& getEmissionPoint(int barrel) const { return this->emissionPoint[barrel]->getAbsCoor(); };
+    inline const Vector& getEmissionPoint() const { return this->emissionPoint[0]->getAbsCoor(); };
+
 
     inline void setDefaultTarget(PNode* defaultTarget) { this->defaultTarget = defaultTarget; };
@@ -158,4 +163,5 @@
 
     Animation3D* getAnimation(WeaponState state, PNode* node = NULL);
+    Animation3D* getAnimation(int barrel, int seg, PNode* node);
     Animation3D* copyAnimation(WeaponState from, WeaponState to);
 
@@ -169,4 +175,15 @@
     bool check() const;
     void debug() const;
+
+    inline int getBarrels() {return this->barrels; };
+    inline int getSegs() { return this->segs; };
+    inline void setBarrels(int barrels) { this->barrels = barrels; };
+    inline void setSegs(int segs) { this->segs = segs; };
+
+    inline Animation3D* getShootAnim(int barrel, int seg) { return this->shootAnim[barrel][seg]; };
+    inline void setShootAnim(int barrel, int seg, PNode* component) { this->shootAnim[barrel][seg] = this->getAnimation(barrel, seg, component); };
+
+    void init2();
+    void deconstr();
 
   protected:
@@ -184,4 +201,6 @@
     static WeaponState   charToState(const std::string& state);
     static const char*   stateToChar(WeaponState state);
+
+
 
   private:
@@ -214,5 +233,5 @@
     float                maxCharge;                        //!< The maximal energy to be loaded onto one projectile (this is only availible if chargeable is enabled)
 
-    OrxGui::GLGuiEnergyWidget* energyWidget;
+    OrxGui::GLGuiEnergyWidgetVertical* energyWidget;
 
     PNode*               defaultTarget;                    //!< A target for targeting Weapons.
@@ -230,5 +249,5 @@
     OrxSound::SoundBuffer  soundBuffers[WA_ACTION_COUNT];   //!< SoundBuffers for all actions @see WeaponAction.
 
-    PNode                  emissionPoint;                   //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default)
+    PNode**                emissionPoint;                   //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default)
 
     bool                   hideInactive;                    //!< Hides the Weapon if it is inactive
@@ -237,4 +256,9 @@
     ClassID                projectile;                      //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.)
     FastFactory*           projectileFactory;               //!< A factory, that produces and handles the projectiles.
+
+    int                    barrels;                         //!< # of barrels
+    int                    segs;                             //!< # of segments, one barrel has
+    Animation3D***         shootAnim;
+
   };
 
Index: trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.cc	(revision 10351)
+++ trunk/src/world_entities/weapons/weapon_manager.cc	(revision 10368)
@@ -103,5 +103,5 @@
 
   this->currentConfigID = 0;
-  this->slotCount = 2;
+  this->slotCount = WM_MAX_SLOTS;
   //this->weaponChange;
 
@@ -114,4 +114,23 @@
   this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
   this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
+
+  this->hideCrosshair();
+
+  this->bFire = false;
+}
+
+void WeaponManager::showCrosshair()
+{
+  this->crosshair->setVisibility( true);
+}
+
+void WeaponManager::hideCrosshair()
+{
+  this->crosshair->setVisibility( false);
+}
+
+void WeaponManager::setRotationSpeed(float speed)
+{
+  this->crosshair->setRotationSpeed(speed);
 }
 
@@ -300,4 +319,5 @@
     if (this->parentEntity->isA(Playable::staticClassID()))
       dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
+    
     weapon->setDefaultTarget(this->crosshair);
   }
@@ -317,9 +337,9 @@
 
 /**
- * @brief does the same as the funtion inclreaseAmmunition, added four your convenience
+ * @brief does the same as the funtion increaseAmmunition, added four your convenience
  * @param weapon, the Weapon to read the ammo-info about.
  * @param ammo how much ammo to add.
  */
-float WeaponManager::inclreaseAmmunition(const Weapon* weapon, float ammo)
+float WeaponManager::increaseAmmunition(const Weapon* weapon, float ammo)
 {
   assert (weapon != NULL);
@@ -400,4 +420,5 @@
   this->currentConfigID = weaponConfig;
   PRINTF(4)("Changing weapon configuration: to %i\n", this->currentConfigID);
+
   for (int i = 0; i < WM_MAX_SLOTS; i++)
     this->currentSlotConfig[i].nextWeapon = this->configs[currentConfigID][i];
@@ -410,14 +431,37 @@
 void WeaponManager::fire()
 {
+//   printf("firing WM: ");
   Weapon* firingWeapon;
   for(int i = 0; i < this->slotCount; i++)
   {
+//     printf("%i ", i);
+	  firingWeapon = this->currentSlotConfig[i].currentWeapon;
+      if( firingWeapon != NULL && firingWeapon->getCurrentState() == WS_SHOOTING) continue;
+	  if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT);
+  }
+//   printf("\n");
+  /*
+	this->crosshair->setRotationSpeed(500);
+	this->crossHairSizeAnim->replay();
+  */
+}
+
+/**
+ * triggers fire of all weapons in the current weaponconfig
+ */
+void WeaponManager::releaseFire()
+{
+  Weapon* firingWeapon;
+  for(int i = 0; i < this->slotCount; i++)
+  {
     firingWeapon = this->currentSlotConfig[i].currentWeapon;
-    if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT);
-  }
+    if( firingWeapon != NULL) firingWeapon->requestAction(WA_NONE);
+  }
+
+  /*
   this->crosshair->setRotationSpeed(500);
   this->crossHairSizeAnim->replay();
-}
-
+  */
+}
 
 /**
@@ -429,9 +473,10 @@
   Weapon* tickWeapon;
 
+
   for(int i = 0; i < this->slotCount; i++)
   {
-/*
-    NICE LITTLE DEBUG FUNCTION
-       if (this->currentSlotConfig[i].currentWeapon != NULL || this->currentSlotConfig[i].nextWeapon != NULL)
+
+    //NICE LITTLE DEBUG FUNCTION
+    /*   if (this->currentSlotConfig[i].currentWeapon != NULL || this->currentSlotConfig[i].nextWeapon != NULL)
       printf("%p %p\n", this->currentSlotConfig[i].currentWeapon, this->currentSlotConfig[i].nextWeapon);*/
 
@@ -455,11 +500,11 @@
         }
       }
-
       // switching to next Weapon
       tickWeapon = this->currentSlotConfig[i].currentWeapon = this->currentSlotConfig[i].nextWeapon;
+      
       if (tickWeapon != NULL)
       {
-           //        if (this->parent != NULL)
-          tickWeapon->toList(this->parentEntity->getOMListNumber());
+        //if (this->parent != NULL)
+        tickWeapon->toList(this->parentEntity->getOMListNumber());
         tickWeapon->requestAction(WA_ACTIVATE);
         this->currentSlotConfig[i].position.activateNode();
Index: trunk/src/world_entities/weapons/weapon_manager.h
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.h	(revision 10351)
+++ trunk/src/world_entities/weapons/weapon_manager.h	(revision 10368)
@@ -60,4 +60,8 @@
     void loadWeapons(const TiXmlElement* root);
 
+    void showCrosshair();
+    void hideCrosshair();
+    void setRotationSpeed(float speed);
+
     void setSlotCount(unsigned int slotCount);
     unsigned int getSlotCount() const { return this->slotCount; };
@@ -91,5 +95,5 @@
 
     float increaseAmmunition(const ClassID& projectileType, float ammo);
-    float inclreaseAmmunition(const Weapon* weapon, float ammo);
+    float increaseAmmunition(const Weapon* weapon, float ammo);
 
     /** @returns a fixed target namely the Crosshair's 3D position */
@@ -99,4 +103,5 @@
     //! @TODO: implement this function (maybe also in Weapon itself)
     void releaseFire();
+    //inline void setFire() { this->bFire = true; };
 
     void tick(float dt);
@@ -127,4 +132,6 @@
 
     std::vector<CountPointer<AmmoContainer> > ammo;                   //!< Containers
+
+    bool                    bFire;
 };
 
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 10351)
+++ trunk/src/world_entities/world_entity.cc	(revision 10368)
@@ -32,7 +32,11 @@
 
 #include "util/loading/load_param.h"
+#include "loading/load_param_xml.h"
+#include "util/loading/factory.h"
+
 #include "obb_tree.h"
 
 #include "elements/glgui_energywidget.h"
+#include "elements/glgui_energywidgetvertical.h"
 
 #include "state.h"
@@ -44,4 +48,6 @@
 #include "kill.h"
 #include "debug.h"
+
+#include "track/track.h"
 
 #include "projectiles/projectile.h"
@@ -86,4 +92,7 @@
   this->_bOnGround = false;
 
+  // Track of this entity
+  this->entityTrack = NULL;
+
   // registering default reactions:
   this->subscribeReaction(CoRe::CREngine::CR_OBJECT_DAMAGE, Projectile::staticClassID());
@@ -148,4 +157,5 @@
   .describe("the fileName of the object information file (optional)");
 
+  // Entity Attributes
   LoadParam(root, "maxHealth", this, WorldEntity, setHealthMax)
   .describe("The Maximum health that can be loaded onto this entity")
@@ -157,4 +167,30 @@
 
   LoadParam(root, "list", this, WorldEntity, toListS);
+
+
+  // Track
+  LoadParamXML(root, "Track", this, WorldEntity, addTrack)
+   .describe("creates and adds a track to this WorldEntity");
+}
+
+
+/**
+ * this functions adds a track to this workd entity. This can be usefull, if you like this WE to follow a some waypoints.
+ * here the track is created and further initializing left for the Track itself
+ */
+void WorldEntity::addTrack(const TiXmlElement* root)
+{
+  // The problem we have is most likely here. The track should be constructed WITH the XML-Code
+  this->entityTrack = new Track(root);
+  this->setParent(this->entityTrack->getTrackNode());
+  this->entityTrack->getTrackNode()->setParentMode(PNODE_ALL);
+  /*LOAD_PARAM_START_CYCLE(root, element);
+  {
+    PRINTF(4)("element is: %s\n", element->Value());
+    Factory::fabricate(element);
+  }
+  LOAD_PARAM_END_CYCLE(element);*/
+  
+
 }
 
@@ -613,5 +649,6 @@
 */
 void WorldEntity::tick(float time)
-{}
+{
+}
 
 
@@ -652,4 +689,7 @@
       this->models[0]->draw();
     }
+    
+    //if (this->entityTrack)
+       //this->entityTrack->drawGraph(0.02);
 
     //     if( this->aabbNode != NULL)
@@ -721,8 +761,8 @@
   if (this->healthWidget == NULL)
   {
-    this->healthWidget = new OrxGui::GLGuiEnergyWidget();
-    this->healthWidget->setDisplayedName(std::string(this->getClassName()) + " Energy:");
-    this->healthWidget->setSize2D(30,400);
-    this->healthWidget->setAbsCoor2D(10,100);
+    this->healthWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    //this->healthWidget->setDisplayedName("Health");
+    //this->healthWidget->setSize2D(100,20);
+    //this->healthWidget->setAbsCoor2D(100,200);
 
     this->updateHealthWidget();
@@ -773,4 +813,5 @@
 void WorldEntity::hit(float damage, WorldEntity* killer)
 {
+
   this->decreaseHealth(damage);
 
Index: trunk/src/world_entities/world_entity.h
===================================================================
--- trunk/src/world_entities/world_entity.h	(revision 10351)
+++ trunk/src/world_entities/world_entity.h	(revision 10368)
@@ -25,5 +25,5 @@
 // FORWARD DECLARATION
 namespace OrxSound { class SoundBuffer; class SoundSource; }
-namespace OrxGui { class GLGuiWidget; class GLGuiBar; class GLGuiEnergyWidget; };
+namespace OrxGui { class GLGuiWidget; class GLGuiBar; class GLGuiEnergyWidget; class GLGuiEnergyWidgetVertical; };
 namespace CoRe { class Collision; }
 
@@ -32,4 +32,6 @@
 class AABBTreeNode;
 class Model;
+class Track;
+class TiXmlElement;
 
 class ObjectInformationFile;
@@ -156,5 +158,5 @@
   void increaseHealthMax(float increaseHealth);
   OrxGui::GLGuiWidget* getHealthWidget();
-  bool hasHealthWidget() const { return this->healthWidget; };
+  bool hasHealthWidget() const { return this->healthWidget != NULL; };
 
   virtual void varChangeHandler( std::list<int> & id );
@@ -185,4 +187,5 @@
 private:
   void updateHealthWidget();
+  void addTrack(const TiXmlElement* root);
 
 
@@ -192,5 +195,5 @@
   float                   health;             //!< The Energy of this Entity, if the Entity has any energy at all.
   float                   healthMax;          //!< The Maximal energy this entity can take.
-  OrxGui::GLGuiEnergyWidget* healthWidget;    //!< The Slider (if wanted).
+  OrxGui::GLGuiEnergyWidgetVertical* healthWidget;    //!< The Slider (if wanted).
 
   std::vector<Model*>     models;             //!< The model that should be loaded for this entity.
@@ -235,4 +238,5 @@
 protected:
   Vector                  velocity;                        //!< speed of the entity
+  Track*                  entityTrack;                     //!< this is the track this entity follows (or NULL if none)
 
 };
