Index: /branches/vs-enhencements/src/util/track/action_box.h
===================================================================
--- /branches/vs-enhencements/src/util/track/action_box.h	(revision 10650)
+++ /branches/vs-enhencements/src/util/track/action_box.h	(revision 10651)
@@ -23,4 +23,9 @@
     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();
Index: /branches/vs-enhencements/src/world_entities/WorldEntities.am
===================================================================
--- /branches/vs-enhencements/src/world_entities/WorldEntities.am	(revision 10650)
+++ /branches/vs-enhencements/src/world_entities/WorldEntities.am	(revision 10651)
@@ -13,4 +13,5 @@
                 world_entities/npcs/attractor_mine.cc \
                 world_entities/npcs/mover.cc \
+		world_entities/npcs/actionbox_enemy.cc \
                 \
                 \
@@ -151,4 +152,5 @@
                 npcs/attractor_mine.h \
                 npcs/mover.h \
+		npcs/actionbox_enemy.h \
                 \
                 environments/environment.h \
Index: /branches/vs-enhencements/src/world_entities/npcs/actionbox_enemy.cc
===================================================================
--- /branches/vs-enhencements/src/world_entities/npcs/actionbox_enemy.cc	(revision 10651)
+++ /branches/vs-enhencements/src/world_entities/npcs/actionbox_enemy.cc	(revision 10651)
@@ -0,0 +1,169 @@
+/*
+   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: Christoph Renner
+   co-programmer:
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "loading/factory.h"
+#include "debug.h"
+#include "loading/load_param.h"
+#include "util/loading/load_param_xml.h"
+#include "state.h"
+#include "player.h"
+#include "playable.h"
+
+#include "actionbox_enemy.h"
+
+ObjectListDefinition(ActionboxEnemy);
+CREATE_FACTORY(ActionboxEnemy);
+
+ActionboxEnemy::ActionboxEnemy(const TiXmlElement* root)
+{
+  PRINTF(0)("ActionboxEnemy\n");
+  
+  this->registerObject(this, ActionboxEnemy::_objectList);
+  this->toList(OM_GROUP_00);
+  
+  this->isActive = true;
+  
+  //TODO init to zero for non-debug
+  this->pitch = 0.0f;
+  this->dPitch = PI;
+  
+  if ( root )
+    this->loadParams( root );
+}
+
+ActionboxEnemy::~ActionboxEnemy()
+{
+}
+
+void ActionboxEnemy::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams( root );
+}
+
+void ActionboxEnemy::tick( float dt )
+{
+  this->pitch += this->dPitch*dt;
+  
+  moveTowardsBox( NULL, dt );
+  return;
+  
+  if ( isActive && State::getActionBox() )
+  {
+    ActionBox* box = State::getActionBox();
+    if ( box->isPointInBox( this->getAbsCoor() ) )
+    {
+      attackPlayer( box, dt );
+    }
+    else
+    {
+      moveTowardsBox( box, dt );
+    }
+  }
+}
+
+void ActionboxEnemy::attackPlayer( ActionBox * box, float dt )
+{
+}
+
+void ActionboxEnemy::moveTowardsBox( ActionBox * box, float dt )
+{
+  Vector targetPos = State::getPlayer()->getPlayable()->getAbsCoor();
+  
+  Vector fw = this->getAbsDir().apply( Vector( 0, 0, -1 ) );
+  fw.normalize();
+  
+  Vector dv = targetPos - this->getAbsCoor();
+  dv.normalize();
+  
+  Vector up = fw.cross( dv )*-1;
+  
+  Quaternion rot(up, 10.0*dt);
+  rot.normalize();
+  Quaternion cur = this->getAbsDir();
+  Quaternion ne = rot * cur;
+  this->setAbsDir( ne );
+  
+  // 1, 0, 0
+  // 0, 1, 0
+  return;
+  Vector k = ne.apply( Vector( 1, 0, 0 ) );
+  k.normalize();
+  
+  Vector vr = k.cross( Vector( 0, 1, 0) );
+  
+  rot = Quaternion(vr, 10.0*dt);
+  rot.normalize();
+  cur = ne;
+  ne = rot * cur;
+  ne.normalize();
+ 
+  this->setAbsDir( ne );
+}
+
+void ActionboxEnemy::draw( ) const
+{
+  Vector fw = this->getAbsDir().apply( Vector( 1, 0, 0 ) );
+  fw.normalize();
+  fw = fw * 100;
+  
+  Vector mp = this->getAbsCoor();
+  Vector op = mp + fw;
+  
+  Vector targetPos = State::getPlayer()->getPlayable()->getAbsCoor();
+  Vector dv = targetPos - this->getAbsCoor();
+  dv.normalize();
+  dv *= 100;
+  dv += mp;
+  
+  Vector up = fw.cross( dv )*-1;
+  up += mp;
+  
+  //PRINTF(0)("DEBUG\n");
+  //mp.debug();
+  //op.debug();
+  
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  glPushAttrib(GL_ENABLE_BIT);
+
+  glDisable(GL_LIGHTING);
+  glDisable(GL_TEXTURE_2D);
+  glDisable(GL_BLEND);
+  glLineWidth(2.0);
+  glColor3f(1.0, 0.0, 0.0 );
+  
+  
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(op.x, op.y, op.z);
+  glEnd();
+  
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(dv.x, dv.y, dv.z);
+  glEnd();
+  
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(up.x, up.y, up.z);
+  glEnd();
+
+  glPopMatrix();
+  
+  WorldEntity::draw();
+}
Index: /branches/vs-enhencements/src/world_entities/npcs/actionbox_enemy.h
===================================================================
--- /branches/vs-enhencements/src/world_entities/npcs/actionbox_enemy.h	(revision 10651)
+++ /branches/vs-enhencements/src/world_entities/npcs/actionbox_enemy.h	(revision 10651)
@@ -0,0 +1,31 @@
+
+#ifndef _NPC_H
+#define _NPC_H
+
+#include "world_entity.h"
+#include "world_entities/weapons/weapon_manager.h"
+#include "track/action_box.h"
+
+class ActionboxEnemy : public WorldEntity
+{
+  ObjectListDeclaration(ActionboxEnemy);
+
+  public:
+    ActionboxEnemy(const TiXmlElement* root = NULL);
+    virtual ~ActionboxEnemy ();
+  
+    virtual void tick(float dt);
+    virtual void draw() const;
+
+    virtual void loadParams(const TiXmlElement* root);
+   
+  private:
+    bool  isActive;
+    float pitch;      // rotate angle around x-axix
+    float dPitch;     // change pitch += dPitch*dt
+    
+    void attackPlayer( ActionBox* box, float dt );
+    void moveTowardsBox( ActionBox* box, float dt );
+};
+
+#endif
