Index: trunk/src/util/Makefile.am
===================================================================
--- trunk/src/util/Makefile.am	(revision 10643)
+++ trunk/src/util/Makefile.am	(revision 10698)
@@ -26,5 +26,6 @@
 			animation/animation_player.cc \
 			\
-			track/track.cc
+			track/track.cc \
+			track/action_box.cc
 
 noinst_HEADERS =        \
@@ -49,3 +50,4 @@
 			animation/t_animation.h \
 			\
-			track/track.h
+			track/track.h \
+			track/action_box.h
Index: trunk/src/util/hud.cc
===================================================================
--- trunk/src/util/hud.cc	(revision 10643)
+++ trunk/src/util/hud.cc	(revision 10698)
@@ -11,5 +11,5 @@
    ### File Specific:
    main-programmer: Benjamin Grauer
-   co-programmer: ...
+   co-programmer: Benjamin Knecht
 */
 
@@ -52,7 +52,7 @@
   this->energyWidget = NULL;
   this->shieldWidget = NULL;
-  this->armorWidget = NULL;
-  //this->leftRect = NULL;
-  //this->rightRect = NULL;
+  this->healthWidget = NULL;
+  this->leftRect = NULL;
+  this->rightRect = NULL;
   this->resX = 1;
   this->resY = 1;
@@ -62,10 +62,16 @@
   this->rightRect = new OrxGui::GLGuiImage();
   this->leftRect = new OrxGui::GLGuiImage();
+  this->topRect = new OrxGui::GLGuiImage();
+  this->bottomRect = new OrxGui::GLGuiImage();
+  this->middleRect = new OrxGui::GLGuiImage();
 
   this->inputLine = new OrxGui::GLGuiInputLine();
-  this->inputLine->setParent2D(this);
+  //this->inputLine->setParent2D(this);
   this->notifier = new OrxGui::GLGuiNotifier();
-  this->notifier->setParent2D(this);
-  notifier->setAbsCoor2D(100,100);
+  this->notifier->setParent2D(this->bottomRect);
+  notifier->setRelCoor2D(5,5);
+  
+  this->barSocket = new OrxGui::GLGuiImage();
+  this->barSocket->setParent2D(this->bottomRect);
 
   this->_radar = new OrxGui::GLGuiRadar();
@@ -88,6 +94,11 @@
 
   delete this->_radar;
+  delete this->barSocket;
   delete this->rightRect;
   delete this->leftRect;
+  delete this->topRect;
+  delete this->bottomRect;
+  delete this->middleRect;
+
   //if (this->shipValuesBox != NULL)
     //delete this->shipValuesBox;
@@ -135,8 +146,8 @@
   }
 
-  this->updateResolution();
-}
-
-void Hud::setShiledWidget(OrxGui::GLGuiWidget* widget)
+  this->updateResolution();  
+}
+
+void Hud::setShieldWidget(OrxGui::GLGuiWidget* widget)
 {
   /*
@@ -169,28 +180,67 @@
 }
 
-void Hud::setArmorWidget(OrxGui::GLGuiWidget* widget)
-{
-  /*
-  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);
-    dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->armorWidget)->setDisplayedImage("textures/gui/gui_health_icon.png");
-    this->armorWidget->show();
-    /*    this->armorWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
-        this->armorWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
+void Hud::setHealthWidget(OrxGui::GLGuiWidget* widget)
+{
+	if( this->playmode == FirstPerson )
+	{
+		this->healthWidget = new OrxGui::GLGuiBar();
+		dynamic_cast<OrxGui::GLGuiBar*> (this->healthWidget)->setMaximum(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (widget)->getBarWidget()->maximum());
+		dynamic_cast<OrxGui::GLGuiBar*> (this->healthWidget)->setValue(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (widget)->getBarWidget()->value());
+		this->healthWidget->setParent2D(this->barSocket);
+	}
+	else
+	{
+	  /*
+	  if (this->shipValuesBox == NULL)
+	    this->createShipValuesBox();
+	  */
+	
+	// decopple old widget
+	  if (this->healthWidget != NULL)
+	  {
+	    this->healthWidget->hide();
+	  }
+	
+	  this->healthWidget = widget;
+	  if (this->healthWidget != NULL)
+	  {
+	    //this->healthWidget->shiftDir2D(270);
+	    //this->shipValuesBox->pack(this->healthWidget);
+	    //dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->healthWidget)->setStandardSettings();
+	    this->healthWidget->setParent2D(this->leftRect);
+	    //dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->healthWidget)->setDisplayedImage("textures/gui/gui_health_icon.png");
+	    this->healthWidget->show();
+	    /*    this->healthWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
+	        this->healthWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
+	  }
+	}
+
+  this->updateResolution();
+}
+
+
+void Hud::setImplantWidget(OrxGui::GLGuiWidget* widget)
+{
+  //if (this->shipValuesBox == NULL)
+    //this->createShipValuesBox();
+
+  // decopple old widget
+  if (this->implantWidget != NULL)
+  {
+    this->implantWidget->hide();
+  }
+
+  this->implantWidget = widget;
+  if (this->implantWidget != 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->implantWidget->setParent2D(this->leftRect);
+    dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->implantWidget)->setDisplayedImage("textures/gui/gui_electronics_icon.png");
+    this->implantWidget->show();
+    /*    this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
+        this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
   }
 
@@ -341,6 +391,9 @@
 
   this->setSize2D(.2 * this->resX, this->resY);
-  this->notifier->setAbsCoor2D(0.7 * this->resX, 0.3 * this->resY);
-  this->notifier->setWidgetSize(0.25 * this->resX, 0.6 * this->resY);
+  if( this->playmode != FirstPerson )
+  {
+	  this->notifier->setAbsCoor2D(0.7 * this->resX, 0.3 * this->resY);
+	  this->notifier->setWidgetSize(0.25 * this->resX, 0.6 * this->resY);
+  }
 
   int overlayWidth = 0;
@@ -348,5 +401,5 @@
     overlayWidth = this->resX * (overlayPercentage)/(200);
   else
-    overlayWidth = this->resX * 0.1;
+    overlayWidth = this->resX / 10; // fixed warning!
   //if (overlayWidth < 100)
     //overlayWidth = 100;
@@ -354,21 +407,35 @@
   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->playmode != FirstPerson )
+  {
+	  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));
+  }
+  else
+  {
+	  this->bottomRect->setParent2D(this);
+	  this->bottomRect->setWidgetSize(float(this->resX), float(overlayWidth));
+	  this->bottomRect->setAbsCoor2D(0, this->resY - overlayWidth);
+	  this->topRect->setParent2D(this);
+	  this->topRect->setWidgetSize(float(this->resX), float(overlayWidth));
+	  this->topRect->setAbsCoor2D(0, 0);
+	  this->middleRect->setParent2D(this);
+	  this->middleRect->setWidgetSize(float(this->resY)/2, float(this->resY)/2);
+	  this->middleRect->setAbsCoor2D(float(this->resX - this->resY/2)/2, float(this->resY)/4);
+  }
 
   if (this->overlayActive == true)
@@ -382,5 +449,8 @@
   {
     PRINTF(4)("UPDATING RADAR\n");
-    this->_radar->setParent2D(this->leftRect);
+    if( this->playmode != FirstPerson )
+    	this->_radar->setParent2D(this->leftRect);
+    else
+    	this->_radar->setParent2D(this->topRect);
     if (radarCenterNode == NULL)
       this->_radar->setCenterNode(State::getPlayer()->getPlayable());
@@ -397,63 +467,75 @@
     
     int statWidgetsNumber = 0;
-    float expectedArmorSizeX = 0;
-    float expectedArmorSizeY = 0;
+    float expectedHealthSizeX = 0;
+    float expectedHealthSizeY = 0;
     float newSizeY = 0; float newSizeX = 0;
     float moduloWidth = 0;
 
-    if (this->armorWidget != NULL)
-    {
-      expectedArmorSizeX = 150;
-      expectedArmorSizeY = 50;
-      statWidgetsNumber++;
-    }
-
+	if( this->playmode != FirstPerson )
+	{
+	    if (this->healthWidget != NULL)
+	    {
+	      expectedHealthSizeX = 150;
+	      expectedHealthSizeY = 50;
+	      statWidgetsNumber++;
+	    }
+
+	    if (this->shieldWidget != NULL)
+	      statWidgetsNumber++;
+	    
+	    if (this->energyWidget != NULL)
+	      statWidgetsNumber++;
+	
+	    if (expectedHealthSizeY * statWidgetsNumber > overlayWidth)
+	    {
+	      newSizeY = overlayWidth / float(statWidgetsNumber);
+	      newSizeX = expectedHealthSizeX;
+	      PRINTF(0)("Statwidgets resized\n");
+	    }
+	    else
+	    {
+	      newSizeY = expectedHealthSizeY;
+	      newSizeX = expectedHealthSizeX;
+	      moduloWidth = int(overlayWidth) % int(expectedHealthSizeY * statWidgetsNumber);
+	    }
+	
+	    float posY = overlayWidth + newSizeX;
+	
+	    if (this->healthWidget != NULL)
+	    {
+	      this->healthWidget->setSize2D(newSizeX, newSizeY);
+	      this->healthWidget->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);
+	    }
+	}
+	else
+	{
+		this->barSocket->setParent2D(this->bottomRect);
+		this->barSocket->setWidgetSize( float(overlayWidth), float(overlayWidth));
+		this->barSocket->setRelCoor2D(0,this->resX - float(overlayWidth));
+		
+		this->healthWidget->setRelCoor2D(10,-20);
+	}
+	
+
+    /*
+    if (this->healthWidget != NULL)
+      this->healthWidget->setRelCoor2D(100,0.2*this->resY + this->healthWidget->getSizeX2D());
     if (this->shieldWidget != NULL)
-      statWidgetsNumber++;
-    
+      this->shieldWidget->setRelCoor2D(60,0.2*this->resY + this->healthWidget->getSizeX2D());
     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->energyWidget->setRelCoor2D(20,0.2*this->resY + this->healthWidget->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);
+    //this->shieldWidget->setRelCoor2D(0.1*this->resX + this->healthWidget->getSizeX2D(),0);
+    //this->energyWidget->setRelCoor2D(0.1*this->resX + this->healthWidget->getSizeX2D() + this->shieldWidget->getSizeX2D(),0);
   }
 
Index: trunk/src/util/hud.h
===================================================================
--- trunk/src/util/hud.h	(revision 10643)
+++ trunk/src/util/hud.h	(revision 10698)
@@ -28,4 +28,15 @@
 
 public:
+
+  typedef enum {
+    Vertical         =  1,       //!< Vertical (seen from left or right/move in x-z)
+    Horizontal       =  2,       //!< Horizontal (seet from the top/move in x-y)
+    FromBehind       =  4,       //!< Seen from behind (move in z-y)
+    Full3D           =  8,       //!< Full featured 3D-mode. (move in all directions x-y-z)
+    FirstPerson      = 16,
+
+    PlaymodeCount    =  5,
+  } Playmode;
+  
   Hud();
   virtual ~Hud();
@@ -36,12 +47,17 @@
   void notifyUser(const std::string& message);
 
+  inline void setMode(Hud::Playmode playmode) {this->playmode = playmode;};
+  inline Hud::Playmode getMode() {return this->playmode;};
 
   void setBackGround();
   void setEnergyWidget(OrxGui::GLGuiWidget* widget);
-  void setShiledWidget(OrxGui::GLGuiWidget* widget);
-  void setArmorWidget(OrxGui::GLGuiWidget* widget);
+  void setShieldWidget(OrxGui::GLGuiWidget* widget);
+  void setHealthWidget(OrxGui::GLGuiWidget* widget);
+  void setImplantWidget(OrxGui::GLGuiWidget* widget);
+
   inline OrxGui::GLGuiWidget* getEnergyWidget() {return this->energyWidget;};
   inline OrxGui::GLGuiWidget* getShieldWidget() {return this->shieldWidget;};
-  inline OrxGui::GLGuiWidget* getArmorWidget() {return this->armorWidget;};
+  inline OrxGui::GLGuiWidget* getHealthWidget() {return this->healthWidget;};
+  inline OrxGui::GLGuiWidget* getImplantWidget() {return this->implantWidget;};
 
   void setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec = NULL);
@@ -82,4 +98,6 @@
   unsigned int             resX;
   unsigned int             resY;
+  
+  Hud::Playmode				playmode; 
 
   float                    travelZoneWidth; //the percentage of the screen, the player has got for his movements. should always be a value between 0 and 1;
@@ -87,5 +105,6 @@
   OrxGui::GLGuiWidget*     energyWidget;
   OrxGui::GLGuiWidget*     shieldWidget;
-  OrxGui::GLGuiWidget*     armorWidget;
+  OrxGui::GLGuiWidget*     healthWidget;
+  OrxGui::GLGuiWidget*     implantWidget;
 
   OrxGui::GLGuiNotifier*   notifier;
@@ -96,4 +115,8 @@
   OrxGui::GLGuiWidget*     rightRect;
   OrxGui::GLGuiWidget*     leftRect;
+  OrxGui::GLGuiWidget*		topRect;
+  OrxGui::GLGuiWidget*		bottomRect;
+  OrxGui::GLGuiWidget*		middleRect;
+  OrxGui::GLGuiWidget*		barSocket;
   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;
Index: trunk/src/util/state.cc
===================================================================
--- trunk/src/util/state.cc	(revision 10643)
+++ trunk/src/util/state.cc	(revision 10698)
@@ -56,4 +56,5 @@
 int State::menuID = -1;
 
+ActionBox* State::actionBox = NULL;
 
 /**
Index: trunk/src/util/state.h
===================================================================
--- trunk/src/util/state.h	(revision 10643)
+++ trunk/src/util/state.h	(revision 10698)
@@ -20,4 +20,5 @@
 class CameraMan;
 class ScriptManager;
+class ActionBox;
 
 
@@ -130,4 +131,9 @@
   /** @returns the scroller-travelnode (center of the screen) */
   static PNode* getTravelNode() { return State::travelNode; }
+  
+  /** sets the action box (this is where the fighting takes place) */
+  static void setActionBox( ActionBox* ab ){ State::actionBox = ab; }
+  /** @returns the action box (this is where the fighting takes place) */
+  static ActionBox* getActionBox(){ return State::actionBox; }
 
 
@@ -146,4 +152,5 @@
   static Player*                player;             //!< A reference to the Player
   static PNode*                 travelNode;         //!< A reference to the scroller-travelnode
+  static ActionBox*             actionBox;          //!< A reference to the action box
 
   static SkyBox*                skyBox;            //!< The SkyBox used in the current world.
Index: trunk/src/util/track/action_box.cc
===================================================================
--- trunk/src/util/track/action_box.cc	(revision 10698)
+++ trunk/src/util/track/action_box.cc	(revision 10698)
@@ -0,0 +1,170 @@
+/*
+   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:
+
+   the actual playing shoult take place within this box
+
+   main-programmer: Christoph Renner
+*/
+
+#include "action_box.h"
+#include "track.h"
+#include "state.h"
+
+/**
+ * this function is called each frame. update your state here
+ * @param time time since last tick
+ */
+void ActionBox::tick( float time )
+{
+  updatePlanes();
+}
+
+/**
+ * draws the box for debugging
+ */
+void ActionBox::draw( ) const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  glPushAttrib(GL_ENABLE_BIT);
+
+  glDisable(GL_LIGHTING);
+  glDisable(GL_TEXTURE_2D);
+  glDisable(GL_BLEND);
+  glLineWidth(2.0);
+  glTranslatef ( track->getTrackNode()->getAbsCoor ().x,
+                track->getTrackNode()->getAbsCoor ().y,
+                track->getTrackNode()->getAbsCoor ().z);
+  Vector tmpRot = track->getTrackNode()->getAbsDir().getSpacialAxis();
+  glRotatef (track->getTrackNode()->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+
+  glColor3f(1.0, 1.0, 0.0);
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(0, height_2, width_2);
+    glVertex3f(0, -height_2, width_2);
+    glVertex3f(0, -height_2, -width_2);
+    glVertex3f(0, height_2, -width_2);
+    glVertex3f(0, height_2, width_2);
+  glEnd();
+
+  glColor3f(1.0, 0.0, 0.0 );
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(depth, height_2 * stretch, width_2 * stretch);
+    glVertex3f(depth, -height_2 * stretch, width_2 * stretch);
+    glVertex3f(depth, -height_2 * stretch, -width_2 * stretch);
+    glVertex3f(depth, height_2 * stretch, -width_2 * stretch);
+    glVertex3f(depth, height_2 * stretch, width_2 * stretch);
+  glEnd();
+
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(depth, height_2 * stretch, width_2 * stretch);
+    glVertex3f(0, height_2, width_2);
+    glVertex3f(0, -height_2, width_2);
+    glVertex3f(depth, -height_2 * stretch, width_2 * stretch);
+  glEnd();
+
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(depth, height_2 * stretch, -width_2 * stretch);
+    glVertex3f(0, height_2, -width_2);
+    glVertex3f(0, -height_2, -width_2);
+    glVertex3f(depth, -height_2 * stretch, -width_2 * stretch);
+  glEnd();
+
+  glPopAttrib();
+  glPopMatrix();
+}
+
+/**
+ * create a new action box. you must not create more than one action box
+ * @param _track track to assign actionbox to 
+ * @param width_2 width/2 of near plane
+ * @param height_2 height/2 of near plane
+ * @param depth distance between near and far plane
+ * @param stretch far plane will be stretched by this factor
+ */
+ActionBox::ActionBox( Track* _track, float width_2, float height_2, float depth, float stretch )
+{
+  assert( _track );
+  assert( State::getActionBox() == NULL );
+  
+  State::setActionBox( this );
+  
+  this->width_2 = width_2;
+  this->height_2 = height_2;
+  this->depth = depth;
+  this->stretch = stretch;
+  this->track = _track;
+  
+  setParent( _track->getTrackNode() );
+    
+  toList( OM_COMMON );
+}
+
+/**
+ * destructor
+ */
+ActionBox::~ActionBox( )
+{
+  assert( State::getActionBox() );
+  State::setActionBox( NULL );
+}
+
+/**
+ * checks wether a point is inside this box
+ * @param pos point to check (absCoor)
+ * @return true if inside
+ */
+bool ActionBox::isPointInBox( const Vector & pos )
+{
+  for ( int i = 0; i<6; i++ )
+  {
+    if ( planes[i].distancePoint( pos ) < 0 )
+    {
+      return false;
+    }
+  }
+  return true;
+}
+
+/**
+ * update planes with new coordiantes. nomals must point to the inside
+ */
+void ActionBox::updatePlanes( )
+{
+  Vector p[7];
+
+  p[0] = Vector( 0.0, height_2, -width_2 );
+  p[1] = Vector( 0.0, height_2, width_2 );
+  p[2] = Vector( 0.0, -height_2, -width_2 );
+  p[3] = Vector( depth, height_2, -width_2 );
+  p[4] = Vector( depth, height_2, width_2 );
+  p[5] = Vector( depth, -height_2, width_2 );
+  p[6] = Vector( depth, -height_2, -width_2 );
+
+  for ( int i = 0; i<7; i++ )
+  {
+    p[i] = track->getTrackNode()->getAbsDir().apply( p[i] );
+    p[i] += track->getTrackNode()->getAbsCoor();
+  }
+
+  planes[0] = Plane( p[1], p[0], p[2] );
+  planes[1] = Plane( p[3], p[4], p[5] );
+  planes[2] = Plane( p[5], p[4], p[1] );
+  planes[3] = Plane( p[2], p[0], p[3] );
+  planes[4] = Plane( p[3], p[0], p[1] );
+  planes[5] = Plane( p[2], p[6], p[5] );
+}
+
+
+
Index: trunk/src/util/track/action_box.h
===================================================================
--- trunk/src/util/track/action_box.h	(revision 10698)
+++ trunk/src/util/track/action_box.h	(revision 10698)
@@ -0,0 +1,43 @@
+/*!
+ * @file action_box.h
+ */
+
+#ifndef _ACTION_BOX_H_
+#define _ACTION_BOX_H_
+
+#include "world_entity.h"
+#include "plane.h"
+
+class Track;
+
+class ActionBox : public WorldEntity
+{
+  public:
+    virtual void tick (float time);
+    virtual void draw () const;
+    
+    ActionBox( Track* _track, float width_2, float height_2, float depth, float stretch );
+    ~ActionBox();
+    
+       
+    bool isPointInBox( const Vector& pos );
+    
+    float getWidth_2(){ return width_2; }
+    float getHeight_2(){ return height_2; }
+    float getDepth(){ return depth; }
+    float getStretch(){ return stretch; }
+    
+  private:
+    void updatePlanes();
+    
+    float width_2;   //! width/2 of near plane
+    float height_2;  //! height/2 of near plane
+    float depth;     //! distance between near and far plane
+    float stretch;   //! far plane will be stretched by this factor
+    
+    Track* track;
+    
+    Plane planes[6];  //! planes for collision. normale must point towards middle
+};
+
+#endif
Index: trunk/src/util/track/track.cc
===================================================================
--- trunk/src/util/track/track.cc	(revision 10643)
+++ trunk/src/util/track/track.cc	(revision 10698)
@@ -29,4 +29,5 @@
 
 #include "debug.h"
+#include "action_box.h"
 
 ObjectListDefinition(Track);
@@ -65,5 +66,8 @@
   this->duration = 20;
   this->endTime = 20;
-  this->width = 10;
+  this->width = 24;
+  this->height = 18;
+  this->depth = 200;
+  this->stretch = 4;
   this->curve = new BezierCurve();
   this->trackNode = new PNode(PNode::getNullParent(), PNODE_ALL);
@@ -71,4 +75,6 @@
   this->localTime = 0;
   this->pause = false;
+  
+  this->actionBox = NULL;
 }
 
@@ -94,4 +100,6 @@
      }
      LOAD_PARAM_END_CYCLE(element);
+
+     LoadParam(root, "ActionBox", this, Track, addActionBox );
 }
 
@@ -252,10 +260,10 @@
        {
            Vector tmp = this->calcPos();
-    
-    
+
+
            Vector dV = tmp - this->trackNode->getAbsCoor();
            float dx = speed * dt;
            float ratio = dx / dV.len();
-    
+
            if( dt > 0.0f)
            {
@@ -264,10 +272,10 @@
            }
            tmp = this->calcPos();
-    
+
            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());
@@ -331,2 +339,17 @@
     glPopMatrix();
 }
+
+/**
+ * creates new action box and assignes it to this track
+ * @param width_2 width/2 of near end
+ * @param height_2 height/2 of near end
+ * @param depth depth
+ * @param stretch far end will be stretched with this factor
+ */
+void Track::addActionBox( float width_2, float height_2, float depth, float stretch )
+{
+  actionBox = new ActionBox( this, width_2, height_2, depth, stretch );
+}
+
+
+
Index: trunk/src/util/track/track.h
===================================================================
--- trunk/src/util/track/track.h	(revision 10643)
+++ trunk/src/util/track/track.h	(revision 10698)
@@ -12,4 +12,5 @@
 class PNode;
 class TiXmlElement;
+class ActionBox;
 
 class Track : public BaseObject
@@ -42,13 +43,17 @@
    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.
+   float                 width;                //!< The width of the action box, next to the player.
+   float                 height;               //!< The Height of the action box, next to the player 
+   float                 depth;                //!< Depth of the action box
+   float                 stretch;              //!< multiplyer between w/h at player and w/h at far end of the action box
 
    int                   nodeCount;            //!< The count of points this Track has.
    Curve*                curve;                //!< The Curve of this Track
+   
+   ActionBox*            getActionBox(){ return this->actionBox; }
 
  private:
    void init();
-
-
+   
  private:
    CurveType            curveType;              //!< The CurveType the entire TrackSystem will have.
@@ -57,4 +62,10 @@
    int                  mode;                   //!< Defines the behaviour of the Track.
    bool                 pause;                  //!< Defines if the track runs (false) or not (true)
+   
+   ActionBox*           actionBox;
+   
+   void addActionBox( float width_2, float height_2, float depth, float stretch );
+   
+
 };
 
