Index: /trunk/src/defs/class_id.h
===================================================================
--- /trunk/src/defs/class_id.h	(revision 6161)
+++ /trunk/src/defs/class_id.h	(revision 6162)
@@ -92,4 +92,6 @@
   CL_TEXTURE                    =    0x00c01000,
   CL_MODEL                      =    0x00c02000,
+  CL_STATIC_MODEL               =    0x00c04000,
+  CL_VERTEX_ARRAY_MODEL         =    0x00c08000,
 
 
@@ -202,6 +204,5 @@
   CL_MATERIAL                   =    0x00000804,
   CL_TEXTURE_SEQUENCE           =    0x00c04805,
-  CL_VERTEX_ARRAY_MODEL         =    0x00000806,
-  CL_OBJMODEL                   =    0x00000807,
+  CL_OBJ_MODEL                  =    0x00000807,
   CL_PROMITIVE_MODEL            =    0x00000808,
   CL_MD2Model                   =    0x00000809,
Index: /trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- /trunk/src/lib/graphics/graphics_engine.cc	(revision 6161)
+++ /trunk/src/lib/graphics/graphics_engine.cc	(revision 6162)
@@ -38,5 +38,5 @@
  #include "class_list.h"
  #include "list.h"
- #include "model.h"
+ #include "static_model.h"
 #endif
 using namespace std;
@@ -285,6 +285,6 @@
   }
   PRINTF(4)("Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
-
-}
+}
+
 
 /**
@@ -322,10 +322,10 @@
     }
     // REBUILDING MODELS
-    const std::list<BaseObject*>* modelList = ClassList::getList(CL_MODEL);
+    const std::list<BaseObject*>* modelList = ClassList::getList(CL_STATIC_MODEL);
     if (texList != NULL)
     {
       std::list<BaseObject*>::const_iterator reModel;
       for (reModel = modelList->begin(); reModel != modelList->end(); reModel++)
-        dynamic_cast<Model*>(*reModel)->rebuild();
+        dynamic_cast<StaticModel*>(*reModel)->rebuild();
     }
 #endif /* __WIN32__ */
Index: /trunk/src/lib/graphics/importer/model.cc
===================================================================
--- /trunk/src/lib/graphics/importer/model.cc	(revision 6161)
+++ /trunk/src/lib/graphics/importer/model.cc	(revision 6162)
@@ -28,5 +28,5 @@
 Model::Model()
 {
-//   this->setClassID(CL_PROTO_ID, "ProtoClass");
+  this->setClassID(CL_MODEL, "Model");
   this->pModelInfo.numVertices = 0;
   this->pModelInfo.numTriangles = 0;
@@ -55,5 +55,5 @@
   const GLfloat* pVertices = NULL;
   const GLfloat* pNorm = NULL;
-  
+
   glBegin(GL_TRIANGLES);
   for( int i = 0; i < this->pModelInfo.numTriangles; ++i)
@@ -64,15 +64,15 @@
       glNormal3f(pNorm[0], pNorm[1], pNorm[2]);
       glVertex3f(pVertices[0], pVertices[1], pVertices[2]);
-      
+
       pNorm = &this->pModelInfo.pNormals[this->pModelInfo.pTriangles[i].indexToNormals[1]];
       pVertices = &this->pModelInfo.pVertices[this->pModelInfo.pTriangles[i].indexToVertices[1]];
       glNormal3f(pNorm[0], pNorm[1], pNorm[2]);
       glVertex3f(pVertices[0], pVertices[1], pVertices[2]);
-      
+
       pNorm = &this->pModelInfo.pNormals[this->pModelInfo.pTriangles[i].indexToNormals[2]];
       pVertices = &this->pModelInfo.pVertices[this->pModelInfo.pTriangles[i].indexToVertices[2]];
       glNormal3f(pNorm[0], pNorm[1], pNorm[2]);
       glVertex3f(pVertices[0], pVertices[1], pVertices[2]);
-      
+
     }
   glEnd();
Index: /trunk/src/lib/graphics/importer/objModel.cc
===================================================================
--- /trunk/src/lib/graphics/importer/objModel.cc	(revision 6161)
+++ /trunk/src/lib/graphics/importer/objModel.cc	(revision 6162)
@@ -34,4 +34,6 @@
 OBJModel::OBJModel(const char* fileName, float scaling) : StaticModel(fileName)
 {
+  this->setClassID(CL_OBJ_MODEL, "OBJModel");
+
   this->objPath = "./";
 
Index: /trunk/src/lib/graphics/importer/static_model.cc
===================================================================
--- /trunk/src/lib/graphics/importer/static_model.cc	(revision 6161)
+++ /trunk/src/lib/graphics/importer/static_model.cc	(revision 6162)
@@ -144,5 +144,5 @@
 StaticModel::StaticModel(const char* modelName)
 {
-  this->setClassID(CL_MODEL, "Model");
+  this->setClassID(CL_STATIC_MODEL, "StaticModel");
   PRINTF(4)("new 3D-Model is being created\n");
   this->setName(modelName);
@@ -550,5 +550,5 @@
       this->currentGroup->currentFace->vertexCount++;
     }
-  
+
   this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount -2;
   this->faceCount += this->currentGroup->currentFace->vertexCount -2;
Index: /trunk/src/world_entities/playable.h
===================================================================
--- /trunk/src/world_entities/playable.h	(revision 6161)
+++ /trunk/src/world_entities/playable.h	(revision 6162)
@@ -34,4 +34,5 @@
 
     virtual void process(const Event &event) = 0;
+    
 
 
Index: /trunk/src/world_entities/space_ships/helicopter.cc
===================================================================
--- /trunk/src/world_entities/space_ships/helicopter.cc	(revision 6161)
+++ /trunk/src/world_entities/space_ships/helicopter.cc	(revision 6162)
@@ -99,5 +99,5 @@
 
 /**
- * initializes a Spaceship
+ * initializes a Helicopter
  */
 void Helicopter::init()
@@ -240,5 +240,4 @@
 void Helicopter::tick (float time)
 {
-     cycle += time;
   // spaceship controlled movement
   this->calculateVelocity(time);
@@ -246,10 +245,15 @@
   Vector move = (velocity)*time;
 
-  //orient the spaceship model in the direction of movement.
-
   // this is the air friction (necessary for a smooth control)
-  if(velocity.len() != 0) velocity -= velocity*0.01;
-
+  if(velocity.len() != 0) velocity -= velocity*0.1;
+
+
+  //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);
@@ -269,6 +273,6 @@
 {
   Vector accel(0.0, 0.0, 0.0);
-  //Vector rot(0.0, 0.0, 0.0);
-  //float rotVal = 0.0;
+  Vector rot(0.0, 0.0, 0.0);
+  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  */
@@ -277,5 +281,15 @@
    {
      //this->shiftCoor(this->getAbsDirX());
-      accel += (this->getAbsDirX())*2;
+
+     accel += Vector(this->getAbsDirX().x,0,this->getAbsDirX().z).getNormalized()*2;
+     if((this->getAbsDirX()).y > -.2)
+     {
+       rot += Vector (0,0,1);
+       rotVal -= time/5;
+     }
+   }
+   else
+   {
+       if(this->getAbsDirX().y < -.02) this->shiftDir(Quaternion(time/5, Vector(0,0,1)));
    }
 
@@ -283,47 +297,71 @@
    {
      //this->shiftCoor((this->getAbsDirX())*-1);
-     accel -= (this->getAbsDirX())*2;
+     accel -= Vector(this->getAbsDirX().x,0,this->getAbsDirX().z).getNormalized()*2;
+     if((this->getAbsDirX()).y < .2)
+     {
+       rot += Vector (0,0,1);
+       rotVal += time/5;
+     }
+   }
+   else
+   {
+         if(this->getAbsDirZ().y > 0.02) this->shiftDir(Quaternion(-time/5, Vector(0,0,1)));
    }
 
   if( this->bLeft /* > -this->getRelCoor().z*2*/)
   {
-    this->shiftDir(Quaternion(time, Vector(0,1,0)));
-//    accel -= rightDirection;
+    //this->shiftDir(Quaternion(time, Vector(0,1,0)));
+    accel -= Vector(this->getAbsDirZ().x,0,this->getAbsDirZ().z).getNormalized()*2;
+    //velocityDir.normalize();
+    if((this->getAbsDirZ()).y < .2)
+    {
+      rot +=Vector(1,0,0);
+      rotVal -= time/5;
+    }
+  }
+  else
+   {
+         if(this->getAbsDirZ().y > 0.02) this->shiftDir(Quaternion(time/5, Vector(1,0,0)));
+   }
+   
+  if( this->bRight /* > this->getRelCoor().z*2*/)
+  {
+    //this->shiftDir(Quaternion(-time, Vector(0,1,0)));
+
+    accel += Vector(this->getAbsDirZ().x,0,this->getAbsDirZ().z).getNormalized()*2;
+    //velocityDir.normalize();
+    if((this->getAbsDirZ()).y > -.2)
+    {
+      rot += Vector(1,0,0);
+      rotVal += time/5;
+    }
+  }
+  else
+   {
+         if(this->getAbsDirZ().y < -0.02) this->shiftDir(Quaternion(-time/5, Vector(1,0,0)));
+   }
+
+  if( this->bRollL /* > -this->getRelCoor().z*2*/)
+  {
+    this->shiftDir(Quaternion(-time, Vector(1,0,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;
+  if( this->bRollR /* > this->getRelCoor().z*2*/)
+  {
+    this->shiftDir(Quaternion(time, Vector(1,0,0)));
+
+    //accel += rightDirection;
     //velocityDir.normalize();
     //rot += Vector(1,0,0);
     //rotVal += .4;
   }
-
-  if( this->bRollL /* > -this->getRelCoor().z*2*/)
-  {
-    this->shiftDir(Quaternion(-time, Vector(1,0,0)));
-//    accel -= rightDirection;
-    //velocityDir.normalize();
-    //rot +=Vector(1,0,0);
-    //rotVal -= .4;
-  }
-  if( this->bRollR /* > this->getRelCoor().z*2*/)
-  {
-    this->shiftDir(Quaternion(time, 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;
+    //this->shiftDir(Quaternion(time, Vector(0,0,1)));
+
+    accel += (this->getAbsDirY())*2;
     //velocityDir.normalize();
     //rot += Vector(0,0,1);
@@ -332,7 +370,7 @@
   if (this->bDescend )
   {
-    this->shiftDir(Quaternion(-time, Vector(0,0,1)));
-
-    //    accel -= upDirection;
+    //this->shiftDir(Quaternion(-time, Vector(0,0,1)));
+
+    accel -= (this->getAbsDirY())*2;
     //velocityDir.normalize();
     //rot += Vector(0,0,1);
@@ -341,6 +379,6 @@
 
   velocity += accel;
-  //rot.normalize();
-  //this->setRelDirSoft(Quaternion(rotVal, rot), 5);
+  rot.normalize();
+  this->shiftDir(Quaternion(rotVal, rot));
 }
 
@@ -373,7 +411,7 @@
 
   if( event.type == SDLK_a)
-      this->bRollL = event.bPressed;
+      this->bLeft = event.bPressed;
   else if( event.type == SDLK_d)
-      this->bRollR = event.bPressed;
+      this->bRight = event.bPressed;
   else if( event.type == KeyMapper::PEV_FIRE1)
       this->bFire = event.bPressed;
@@ -382,5 +420,8 @@
   else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
     this->getWeaponManager()->previousWeaponConfig();
-
+  else if( event.type == SDLK_e)
+    this->bAscend = event.bPressed; //this->shiftCoor(0,.1,0);
+  else if( event.type == SDLK_c)
+    this->bDescend = event.bPressed; //this->shiftCoor(0,-.1,0);
   else if( event.type == SDLK_w)
     this->bUp = event.bPressed; //this->shiftCoor(0,.1,0);
@@ -391,4 +432,5 @@
     this->xMouse = event.xRel;
     this->yMouse = event.yRel;
+    if(((this->getAbsDirX().y) <= .2 && yMouse > 0) || ((this->getAbsDirX().y) >= -.2 && yMouse < 0)) yMouse = 0;
     this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1)));
   }
Index: /trunk/src/world_entities/space_ships/helicopter.h
===================================================================
--- /trunk/src/world_entities/space_ships/helicopter.h	(revision 6161)
+++ /trunk/src/world_entities/space_ships/helicopter.h	(revision 6162)
@@ -65,4 +65,6 @@
     float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
     float                 acceleration;       //!< the acceleration of the player.
+    
+    float                 airViscosity;
 
 };
Index: /trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /trunk/src/world_entities/space_ships/space_ship.cc	(revision 6161)
+++ /trunk/src/world_entities/space_ships/space_ship.cc	(revision 6162)
@@ -119,5 +119,4 @@
   mouseSensitivity = 0.001;
   airViscosity = 1.0;
-
   cycle = 0.0;
 
@@ -125,5 +124,5 @@
   travelSpeed = 15.0;
   this->velocity = Vector(0.0,0.0,0.0);
-  this->velocityDir = Vector(1.0,0.0,0.0);
+  this->mouseDir = this->getAbsDir();
 
 //   GLGuiButton* button = new GLGuiPushButton();
@@ -175,4 +174,7 @@
 //   this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
 
+  this->getWeaponManager()->getFixedTarget()->setParent(this);
+  this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0);
+
 }
 
@@ -265,5 +267,11 @@
   velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;
   velocity = (velocity.getNormalized())*travelSpeed;
-
+  
+  //orient the spaceship in direction of the mouse
+   rotQuat = Quaternion::quatSlerp( this->getAbsDir(),mouseDir,fabsf(time)*3);
+   if (this->getAbsDir().distance(rotQuat) > 0.001)  
+    this->setAbsDir( rotQuat);
+   //this->setAbsDirSoft(mouseDir,5);
+   
   // this is the air friction (necessary for a smooth control)
   if(velocity.len() != 0) velocity -= velocity*0.01;
@@ -293,5 +301,7 @@
 {
   Vector accel(0.0, 0.0, 0.0);
-  //Vector rot(0.0, 0.0, 0.0);
+  /*
+  Vector rot(0.0, 0.0, 0.0); // wird benötigt für Helicopter
+  */
   //float rotVal = 0.0;
   /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
@@ -302,4 +312,9 @@
      //this->shiftCoor(this->getAbsDirX());
       accel += (this->getAbsDirX())*2;
+      
+      /* Heli-Steuerung
+         accel += (this->getAbsDirX()*2;
+         if(
+      */
    }
 
@@ -331,5 +346,5 @@
   if( this->bRollL /* > -this->getRelCoor().z*2*/)
   {
-    this->shiftDir(Quaternion(-time, Vector(1,0,0)));
+    mouseDir *= Quaternion(-time, Vector(1,0,0));
 //    accel -= rightDirection;
     //velocityDir.normalize();
@@ -339,5 +354,5 @@
   if( this->bRollR /* > this->getRelCoor().z*2*/)
   {
-    this->shiftDir(Quaternion(time, Vector(1,0,0)));
+    mouseDir *= Quaternion(time, Vector(1,0,0));
 
     //    accel += rightDirection;
@@ -407,5 +422,7 @@
     this->xMouse = event.xRel;
     this->yMouse = event.yRel;
-    this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1)));
+    mouseDir *= (Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1)));
+    if( xMouse*xMouse + yMouse*yMouse < 0.9)
+     this->setAbsDir(mouseDir);
   }
 }
Index: /trunk/src/world_entities/space_ships/space_ship.h
===================================================================
--- /trunk/src/world_entities/space_ships/space_ship.h	(revision 6161)
+++ /trunk/src/world_entities/space_ships/space_ship.h	(revision 6162)
@@ -8,4 +8,5 @@
 
 #include "playable.h"
+
 
 template<class T> class tList;
@@ -64,5 +65,6 @@
 
     Vector                velocity;           //!< the velocity of the player.
-    Vector                velocityDir;        //!< the direction of the velocity of the spaceship
+    Quaternion            mouseDir;           //!< the direction where the player wants to fly
+    Quaternion rotQuat;
     float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
     float                 acceleration;       //!< the acceleration of the player.
Index: /trunk/src/world_entities/weapons/crosshair.cc
===================================================================
--- /trunk/src/world_entities/weapons/crosshair.cc	(revision 6161)
+++ /trunk/src/world_entities/weapons/crosshair.cc	(revision 6162)
@@ -67,5 +67,5 @@
   this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0);
 
-//  this->setBindNode(this);
+  this->setBindNode(this);
   this->material = new Material;
 
@@ -166,5 +166,5 @@
 {
   glPushMatrix();
-  glTranslatef(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2, 0);
+  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
 
   glRotatef(this->getAbsDir2D(), 0,0,1);
Index: /trunk/src/world_entities/weapons/guided_missile.cc
===================================================================
--- /trunk/src/world_entities/weapons/guided_missile.cc	(revision 6161)
+++ /trunk/src/world_entities/weapons/guided_missile.cc	(revision 6162)
@@ -45,7 +45,7 @@
   this->energyMin = 1;
   this->energyMax = 10;
-  this->lifeSpan = 5.0;
-  this->agility = 5.0;
-  this->maxVelocity = 100;
+  this->lifeSpan = 10.0;
+  this->agility = 4;
+  this->maxVelocity = 75;
 
   this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5);
@@ -147,14 +147,26 @@
 void GuidedMissile::tick (float time)
 {
-  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
+
   if (this->target != NULL && this->target->getParent() != PNode::getNullParent())
    {
-     velocity += ((target->getAbsCoor() - this->getAbsCoor()).getNormalized())*agility;
-     float speed = velocity.len();
-     if (speed > this->maxVelocity)
-       velocity *= maxVelocity/speed;
+    speed = velocity.len();
+    diffVector = ((target->getAbsCoor() - this->getAbsCoor()).getNormalized());
+
+    if(velocity.dot(diffVector) != 0)
+    {
+     correctionVector = (( ( diffVector *  (speed * speed/( velocity.dot(diffVector ) ) )) - velocity).getNormalized()) * agility;
+
+      if(velocity.dot(diffVector) > 0)
+        velocity += correctionVector;
+      else if (velocity.dot(diffVector) < 0)
+        velocity -= correctionVector;
+    }
+    else
+      velocity += diffVector * agility;
 
      this->setAbsDir(Quaternion(velocity, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)));
    }
+
+  velocity *= maxVelocity/velocity.len();
   Vector v = this->velocity * (time);
   this->shiftCoor(v);
Index: /trunk/src/world_entities/weapons/guided_missile.h
===================================================================
--- /trunk/src/world_entities/weapons/guided_missile.h	(revision 6161)
+++ /trunk/src/world_entities/weapons/guided_missile.h	(revision 6162)
@@ -40,4 +40,7 @@
     float                             agility;
     float                             maxVelocity;
+    float                             speed;
+    Vector                            diffVector ;
+    Vector                            correctionVector;
 
     WorldEntity* hitEntity; // FIXME TEMPORARY
Index: /trunk/src/world_entities/weapons/laser.cc
===================================================================
--- /trunk/src/world_entities/weapons/laser.cc	(revision 6161)
+++ /trunk/src/world_entities/weapons/laser.cc	(revision 6162)
@@ -45,5 +45,5 @@
   this->energyMin = 1;
   this->energyMax = 10;
-  this->lifeSpan = 1.0;
+  this->lifeSpan = 5.0;
 
   this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5);
Index: /trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- /trunk/src/world_entities/weapons/test_gun.cc	(revision 6161)
+++ /trunk/src/world_entities/weapons/test_gun.cc	(revision 6162)
@@ -184,5 +184,5 @@
   pj->setParent(PNode::getNullParent());
 
-  pj->setVelocity(this->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*50+VECTOR_RAND(5));
+  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5));
 
   pj->setAbsCoor(this->getEmissionPoint());
