Index: /trunk/src/world_entities/space_ships/helicopter.cc
===================================================================
--- /trunk/src/world_entities/space_ships/helicopter.cc	(revision 6723)
+++ /trunk/src/world_entities/space_ships/helicopter.cc	(revision 6724)
@@ -36,5 +36,5 @@
 
 /**
- *  creates the controlable Spaceship
+ *  creates the controlable Helicopter
  */
 Helicopter::Helicopter()
@@ -44,5 +44,5 @@
 
 /**
- *  destructs the spaceship, deletes alocated memory
+ *  destructs the helicopter, deletes alocated memory
  */
 Helicopter::~Helicopter ()
@@ -51,6 +51,6 @@
 
 /**
- * loads a Spaceships information from a specified file.
- * @param fileName the name of the File to load the spaceship from (absolute path)
+ * loads a Helicopter information from a specified file.
+ * @param fileName the name of the File to load the helicopter from (absolute path)
  */
 Helicopter::Helicopter(const char* fileName)
@@ -108,5 +108,5 @@
   this->setClassID(CL_HELICOPTER, "Helicopter");
 
-  PRINTF(4)("SPACESHIP INIT\n");
+  PRINTF(4)("HELICOPTER INIT\n");
 
   this->loadModel("models/ships/helicopter_#.obj", 1.0);
@@ -118,8 +118,29 @@
   xMouse = yMouse = 0;
   mouseSensitivity = 0.05;
+  controlVelocityX = 100;
+  controlVelocityY = 100;
   //rotorspeed = 1;
   //tailrotorspeed = 0;
 
   //cycle = 0.0;
+  
+  // cameraissue
+  this->cameraNode.setParent(this);
+  this->cameraNode.setParentMode(PNODE_ALL);
+  
+  
+  // rotors
+  this->topRotor.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->tailRotor.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  
+  this->topRotor.setParent(this);
+  this->tailRotor.setParent(this);
+  
+  this->topRotor.setRelCoor(Vector(-0.877,0.627,0));
+  this->tailRotor.setRelCoor(Vector(-4.43,0.297,0.068));
+  this->tailRotor.setAbsDir(Quaternion(M_PI_2,Vector(1,0,0)));
+  
+  this->loadModel("models/ships/rotor.obj",1.0,3);
+  this->loadModel("models/ships/rotor.obj",0.2,4);
 
 
@@ -127,5 +148,4 @@
   this->velocity = Vector(0.0,0.0,0.0);
   this->velocityDir = Vector(1.0,0.0,0.0);
-
 //   GLGuiButton* button = new GLGuiPushButton();
 //   button->show();
@@ -177,6 +197,6 @@
 //   this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
 
-  this->getWeaponManager()->getFixedTarget()->setParent(this);
-  this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0);
+  this->getWeaponManager()->getFixedTarget()->setParent(&(this->cameraNode));
+  this->getWeaponManager()->getFixedTarget()->setRelCoor(0,0,0);
 
   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
@@ -193,5 +213,10 @@
 }
 
-
+void  Helicopter::attachCamera()
+{
+  State::getCamera()->setParentSoft(this->getWeaponManager()->getFixedTarget());
+  State::getCameraTarget()->setParentSoft(this->getWeaponManager()->getFixedTarget());
+
+}
 
 
@@ -221,5 +246,5 @@
 
 /**
- *  the action occuring if the spaceship left the game
+ *  the action occuring if the helicopter left the game
 */
 void Helicopter::leftWorld ()
@@ -249,13 +274,15 @@
 void Helicopter::tick (float time)
 {
-  /*
-  tailrotorspeed += xMouse/20;
-  if (tailrotorspeed >= 0.07) tailrotorspeed = 0.07;
-  else if (tailrotorspeed <= -0.07) tailrotorspeed = -0.07;
-
-  if (tailrotorspeed > 0.0008) tailrotorspeed -= 0.001;
-  else if (tailrotorspeed < -0.0008) tailrotorspeed += 0.001;
-  if (tailrotorspeed <= 0.001 && tailrotorspeed >= -0.001) tailrotorspeed = 0;
-  */
+  if( xMouse != 0 || yMouse != 0)
+   {
+    if (xMouse > controlVelocityX) xMouse = controlVelocityX;
+    else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX;
+    if (yMouse > controlVelocityY) yMouse = controlVelocityY;
+    else if (yMouse < -controlVelocityY) yMouse = -controlVelocityY;
+  }
+  
+  // rotorrotation
+  this->topRotor.shiftDir(Quaternion(time*10, Vector(0,1,0)));
+  this->tailRotor.shiftDir(Quaternion(time*10, Vector(0,1,0)));
   
   // spaceship controlled movement
@@ -419,4 +446,28 @@
 {
   WorldEntity::draw();
+  
+  glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+
+    /* translate */
+    glTranslatef (this->topRotor.getAbsCoor ().x,
+                  this->topRotor.getAbsCoor ().y,
+                  this->topRotor.getAbsCoor ().z);
+    Vector tmpRot = this->topRotor.getAbsDir().getSpacialAxis();
+    glRotatef (this->topRotor.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+    this->getModel(3)->draw();
+
+    glPopMatrix ();
+    glPushMatrix();
+
+    /* translate */
+    glTranslatef (this->tailRotor.getAbsCoor ().x,
+                  this->tailRotor.getAbsCoor ().y,
+                  this->tailRotor.getAbsCoor ().z);
+    tmpRot = this->tailRotor.getAbsDir().getSpacialAxis();
+    glRotatef (this->tailRotor.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+    this->getModel(4)->draw();
+
+    glPopMatrix ();
 
   this->getWeaponManager()->draw();
@@ -465,6 +516,22 @@
     this->yMouse = event.yRel*mouseSensitivity;
 
-    this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))/*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1))*/);
-  }
+    this->shiftDir(Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0)));
+    
+    Quaternion yDir = Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1));
+
+    
+    if ((this->cameraNode.getAbsDirY()).y < 0.5)
+    {
+     if((this->cameraNode.getAbsDirX()).y > 0)
+     {
+        if(yMouse > 0) this->cameraNode.shiftDir(yDir);
+     }
+     else
+     {
+         if(yMouse < 0) this->cameraNode.shiftDir(yDir);
+     }
+    }
+    else this->cameraNode.shiftDir(yDir);;
+    }
 }
 
Index: /trunk/src/world_entities/space_ships/helicopter.h
===================================================================
--- /trunk/src/world_entities/space_ships/helicopter.h	(revision 6723)
+++ /trunk/src/world_entities/space_ships/helicopter.h	(revision 6724)
@@ -26,4 +26,5 @@
     virtual void enter();
     virtual void leave();
+    virtual void attachCamera();
 
     virtual void postSpawn();
@@ -59,5 +60,12 @@
     int                   yInvert;
     float                 mouseSensitivity;   //!< the mouse sensitivity
+    int                   controlVelocityX;
+    int                   controlVelocityY;
     //float                 cycle;              //!< hovercycle
+    
+    PNode                 topRotor;
+    PNode                 tailRotor;
+    
+    PNode                 cameraNode;
 
     Vector                velocity;           //!< the velocity of the player.
Index: /trunk/src/world_entities/space_ships/hover.cc
===================================================================
--- /trunk/src/world_entities/space_ships/hover.cc	(revision 6723)
+++ /trunk/src/world_entities/space_ships/hover.cc	(revision 6724)
@@ -110,5 +110,5 @@
   PRINTF(4)("HOVER INIT\n");
 
-  this->loadModel("models/ships/fighter.obj", 1.0);
+  this->loadModel("models/ships/nimrod#.obj", 1.0);
 
   EventHandler::getInstance()->grabEvents(true);
@@ -118,4 +118,6 @@
   xMouse = yMouse = 0;
   mouseSensitivity = 0.05;
+  controlVelocityX = 100;
+  controlVelocityY = 100;
 
 
@@ -241,6 +243,12 @@
 void Hover::tick (float time)
 {
-  
-  
+  if( xMouse != 0 || yMouse != 0)
+   {
+    if (xMouse > controlVelocityX) xMouse = controlVelocityX;
+    else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX;
+    if (yMouse > controlVelocityY) yMouse = controlVelocityY;
+    else if (yMouse < -controlVelocityY) yMouse = -controlVelocityY;
+   }
+   
   Quaternion xDir = Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0));
   Quaternion yDir = Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1));
@@ -261,7 +269,6 @@
   else this->shiftDir(xDir*yDir);
   
-  if((this->getAbsDirZ()).y > 0.1) this->shiftDir(Quaternion(0.01,Vector(1,0,0)));
-  else if((this->getAbsDirZ()).y < -0.1) this->shiftDir(Quaternion(-0.01,Vector(1,0,0)));
-
+  if((this->getAbsDirZ()).y > 0.05) this->shiftDir(Quaternion(0.02,Vector(1,0,0)));
+  else if((this->getAbsDirZ()).y < -0.05) this->shiftDir(Quaternion(-0.02,Vector(1,0,0)));
   
   // spaceship controlled movement
Index: /trunk/src/world_entities/space_ships/hover.h
===================================================================
--- /trunk/src/world_entities/space_ships/hover.h	(revision 6723)
+++ /trunk/src/world_entities/space_ships/hover.h	(revision 6724)
@@ -58,4 +58,6 @@
     float                 yMouse;             //!< mouse moved in y-Direction
     float                 mouseSensitivity;   //!< the mouse sensitivity
+    int                   controlVelocityX;
+    int                   controlVelocityY;
 
     Vector                velocity;           //!< the velocity of the player.
Index: /trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /trunk/src/world_entities/space_ships/space_ship.cc	(revision 6723)
+++ /trunk/src/world_entities/space_ships/space_ship.cc	(revision 6724)
@@ -373,5 +373,9 @@
      //this->shiftCoor((this->getAbsDirX())*-1);
      //accel -= (this->getAbsDirX())*2;
+    //if(velocity.len() > 50)
      accel -= (this->getAbsDirX())*0.5*acceleration;
+
+
+
    }
 
Index: /trunk/src/world_entities/weapons/aim.cc
===================================================================
--- /trunk/src/world_entities/weapons/aim.cc	(revision 6723)
+++ /trunk/src/world_entities/weapons/aim.cc	(revision 6724)
@@ -73,6 +73,7 @@
   this->source = NULL;
 
-  this->range = 0;
-  this->angle = 0;
+  this->range = 10000;
+  this->angle = M_PI_4;
+  this->group = OM_GROUP_01;
   this->anim = new tAnimation<Aim>(this, &Aim::setSize);
   this->anim->setInfinity(ANIM_INF_CONSTANT);
@@ -106,11 +107,7 @@
 {
   std::list<WorldEntity*>::iterator entity;
-  Vector diffVec(0.0, 0.0, 0.0);
-  diffVec = ( this->getAbsCoor() - this->source->getAbsCoor() );
-
-//only look for target if the aim hasn`t locked a target yet or if the actual target is out of range
-  if( this == PNode::getNullParent() || diffVec.len() > range  || ( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
-  for (entity = State::getObjectManager()->getObjectList(OM_GROUP_00).begin();
-       entity != State::getObjectManager()->getObjectList(OM_GROUP_00).end();
+
+  for (entity = State::getObjectManager()->getObjectList(group).begin();
+       entity != State::getObjectManager()->getObjectList(group).end();
        entity ++)
   {
@@ -119,5 +116,5 @@
     if ( diffVec.len() < range  &&  acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) < angle)
     {
-      if (this->getParent() != (*entity))
+      //if (this->getParent() != (*entity))
       {
         this->anim->replay();
@@ -127,6 +124,10 @@
     }
   }
-//if no target found:
-  this->setParent(PNode::getNullParent());
+
+   //if no target found:
+   this->setParent(PNode::getNullParent());
+
+
+
 }
 
@@ -165,5 +166,13 @@
 
 //  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
+  diffVec = ( this->getAbsCoor() - this->source->getAbsCoor() );
+//only look for target if the aim hasn`t locked a target yet or if the actual target is out of range
+   if(this->getParent() == PNode::getNullParent() || 
+      diffVec.len() > range  || 
+      ( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
+    {
      this->searchTarget();
+    }
+
 //   float z = 0.0f;
 //   glReadPixels ((int)this->getAbsCoor2D().x,
@@ -196,4 +205,6 @@
 {
 
+ if( this->getParent() != PNode::getNullParent() )
+  {
   glPushMatrix();
   glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
@@ -212,4 +223,5 @@
   glEnd();
   glPopMatrix();
-
-}
+  }
+
+}
Index: /trunk/src/world_entities/weapons/aim.h
===================================================================
--- /trunk/src/world_entities/weapons/aim.h	(revision 6723)
+++ /trunk/src/world_entities/weapons/aim.h	(revision 6724)
@@ -9,4 +9,5 @@
 #include "p_node.h"
 #include "element_2d.h"
+#include "object_manager.h"
 
 // FORWARD DECLARATION
@@ -42,4 +43,5 @@
   void setRange(float range){this->range = range;};
   void setAngle(float angle){this->angle = angle;};
+  void setGroup(OM_LIST group){this->group = group;};
 
   void setSize(float size);
@@ -58,4 +60,6 @@
    float            range;                //!<
    float            angle;                //!<
+   Vector           diffVec;
+   OM_LIST          group;
 
    PNode*           source;               //!< Where this Shot has come from.
Index: /trunk/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- /trunk/src/world_entities/weapons/aiming_turret.cc	(revision 6723)
+++ /trunk/src/world_entities/weapons/aiming_turret.cc	(revision 6724)
@@ -98,6 +98,6 @@
   this->target = new Aim(this);
   this->target->setVisibility(false);
-  this->target->setRange(100);
-  this->target->setAngle(M_PI);
+  this->target->setRange(1000);
+  this->target->setAngle(M_PI_4);
 }
 
@@ -148,5 +148,4 @@
   pj->setAbsDir(this->getAbsDir());
   pj->activate();
-  this->target->searchTarget();
 }
 
Index: /trunk/src/world_entities/weapons/targeting_turret.cc
===================================================================
--- /trunk/src/world_entities/weapons/targeting_turret.cc	(revision 6723)
+++ /trunk/src/world_entities/weapons/targeting_turret.cc	(revision 6724)
@@ -94,5 +94,5 @@
   this->target->setVisibility(false);
   this->target->setRange(100);
-  this->target->setAngle(M_PI_4/2);
+  this->target->setAngle(M_PI_4/16);
   this->lockedTime = 0;
   this->neededLockTime = 2;
@@ -148,10 +148,10 @@
             /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
 
-  pj->setTarget(this->target->getParent());
+  pj->setTarget(lockedTarget);
   pj->setParent(PNode::getNullParent());
   pj->setAbsCoor(this->getEmissionPoint());
   pj->setAbsDir(this->getAbsDir());
   pj->activate();
-  this->target->searchTarget();
+  
 }
 
Index: /trunk/src/world_entities/weapons/turret.cc
===================================================================
--- /trunk/src/world_entities/weapons/turret.cc	(revision 6723)
+++ /trunk/src/world_entities/weapons/turret.cc	(revision 6724)
@@ -116,7 +116,7 @@
 void Turret::tick(float dt)
 {
-/*
+
   Quaternion quat;
-  Vector direction = this->getAbsCoor();/*this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();
+  Vector direction = this->getAbsCoor();/*this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();*/
 
   direction.normalize();
@@ -127,5 +127,5 @@
     quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
 
-  this->setAbsDirSoft(quat, 5);*/
+  this->setAbsDirSoft(quat, 5);
 }
 
