Index: branches/playability/src/world_entities/space_ships/space_ship.cc
===================================================================
--- branches/playability/src/world_entities/space_ships/space_ship.cc	(revision 10016)
+++ branches/playability/src/world_entities/space_ships/space_ship.cc	(revision 10017)
@@ -74,4 +74,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))
                        );
 
@@ -90,6 +91,6 @@
 SpaceShip::SpaceShip(const std::string& fileName)
     : secWeaponMan(this),
-    supportedPlaymodes(Playable::Full3D || Playable::Horizontal || Playable::Vertical),
-    playmode(Playable::Full3D)
+    supportedPlaymodes(Playable::Vertical) ,
+    playmode(Playable::Vertical)
 {
   this->init();
@@ -113,6 +114,6 @@
 SpaceShip::SpaceShip(const TiXmlElement* root)
     : secWeaponMan(this),
-    supportedPlaymodes(Playable::Full3D || Playable::Horizontal || Playable::Vertical),
-    playmode(Playable::Full3D)
+    supportedPlaymodes(Playable::Vertical) ,
+    playmode(Playable::Vertical)
 {
   this->init();
@@ -205,7 +206,9 @@
 
   this->loadModel("models/ships/mantawing.obj");
-
-  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
-
+  //this->setVisibiliy(false);
+
+  bForward = bBackward = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
+  
+  /*
   xMouse = yMouse = 0;
   yInvert = 1;
@@ -215,4 +218,5 @@
   controlVelocityY = 150;
   shipInertia = 1.5;
+  */
   //  cycle = 0.0;
 
@@ -220,9 +224,21 @@
   this->setHealth(shieldCur);
 
-  travelSpeed = 0.0;
-  acceleration = 3;
+  this->travelNode = new PNode();
+
+  // camera - issue
+  //this->cameraNode = State::getCameraNode();
+  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
+
+  this->travelSpeed = 0.0;
+  this->cameraLook = 0.0f;
+  this->acceleration = 20.0f;
+  //this->airFriction = 0.0f;
+  this->cameraSpeed = 0.0;
+  /*
   this->velocity = this->getAbsDirX()*travelSpeed;
   this->mouseDir = this->getAbsDir();
   this->pitchDir = this->getAbsDir();
+  */
 
 
@@ -329,7 +345,6 @@
   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 ) );
@@ -340,4 +355,22 @@
   registerVar( new SynchronizeableBool( &bRollL, &bRollL, "bRollL", PERMISSION_OWNER ) );
   registerVar( new SynchronizeableBool( &bRollR, &bRollR, "bRollR", PERMISSION_OWNER ) );
+  */
+
+  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 SynchronizeableFloat( &cameraLook, &cameraLook, "cameraLook", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) );
+
+  registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity", PERMISSION_MASTER_SERVER ) );
+
+  this->enterPlaymode(Playable::Vertical);
+  //this->airFriction = 0.5f;
+  this->travelDistance = Vector2D(50.0, 50.0);
+  this->travelSpeed = 50;
+  this->cameraSpeed = 40;
+
+  this->travelNode->debugDraw();
 }
 
@@ -352,15 +385,41 @@
 }
 
-void SpaceShip::setPlayDirection(const Quaternion& quat, float speed)
-{
-  this->mouseDir = quat;
-}
+void SpaceShip::setPlayDirection(const Quaternion& rot, float speed)
+{
+  this->direction = Quaternion (rot.getHeading(), Vector(0,1,0));
+}
+
+void SpaceShip::setTravelSpeed(float travelSpeed)
+{
+  this->travelSpeed = travelSpeed;
+}
+
+/*
+void SpaceShip::setTravelHeight(float travelHeight)
+{
+  if (this->toTravelHeight == NULL)
+    this->toTravelHeight = new float;
+  *this->toTravelHeight = travelHeight;
+}
+*/
+
+
+void SpaceShip::setTravelDistance(const Vector2D& distance)
+{
+  this->travelDistance = distance;
+}
+
+void SpaceShip::setTravelDistance(float x, float y)
+{
+  this->setTravelDistance(Vector2D(x, y));
+}
+
 
 
 void SpaceShip::reset()
 {
-  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
-
-  xMouse = yMouse = 0;
+  bForward = bBackward = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
+
+  //xMouse = yMouse = 0;
 
   this->setHealth(80);
@@ -452,5 +511,5 @@
 
 
-
+  /*
   if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() )
   {
@@ -465,34 +524,42 @@
     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;
-
+
+  //is->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->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->burstEmitter->setEmissionRate(travelSpeed);
   this->burstEmitter->setEmissionVelocity(travelSpeed*.5, travelSpeed *.1);
 
   //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)
@@ -510,5 +577,7 @@
   //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());
@@ -516,99 +585,54 @@
 }
 
-/**
- *  calculate the velocity
- * @param time the timeslice since the last frame
+/*
+void SpaceShip::calculateVelocity (float time)
+{
+  Vector accel(0.0, 0.0, 0.0);
+  /* calculate the direction in which the craft is heading  */
+  /*
+  if( this->bUp )
+  {
+    accel += (this->getAbsDirX())*acceleration;
+
+  }
+
+  if( this->bDown )
+  {
+    accel -= (this->getAbsDirX())*0.5*acceleration;
+
+  }
+
+  if( this->bLeft)
+  {
+    this->shiftDir(Quaternion(time, Vector(0,1,0)));
+  }
+  if( this->bRight)
+  {
+    this->shiftDir(Quaternion(-time, Vector(0,1,0)));
+  }
+
+
+  if( this->bRollL)
+  {
+    mouseDir *= Quaternion(-time*2, Vector(1,0,0));
+  }
+  if( this->bRollR)
+  {
+    mouseDir *= Quaternion(time*2, Vector(1,0,0));
+
+  }
+  if (this->bAscend )
+  {
+    this->shiftDir(Quaternion(time, Vector(0,0,1)));
+  }
+  if (this->bDescend )
+  {
+    this->shiftDir(Quaternion(-time, Vector(0,0,1)));
+  }
+
+  velocity += accel*time*10;
+
+}
 */
-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);
-
-}
 
 /**
@@ -620,15 +644,18 @@
 
   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;
   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 == EV_MOUSE_MOTION)
   {
@@ -637,4 +664,5 @@
     this->yMouse += event.yRel;
   }
+  */
 }
 
@@ -721,5 +749,4 @@
   }
   // weaponMan.increaseAmmunition( weapon, energy);
-  
 }
 
@@ -727,8 +754,202 @@
 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;
+
+
+    case Playable::Vertical:
+      if (State::getCameraNode != NULL)
+      {
+        this->debugNode(1);
+        this->travelNode->debugNode(1);
+
+        this->travelNode->setAbsCoor(this->getAbsCoor());
+        this->travelNode->updateNode(0.01f);
+
+        this->setParent(this->travelNode);
+        this->setRelCoor(0,0,0);
+
+        State::getCameraNode()->setParentSoft(this->travelNode);
+        State::getCameraNode()->setRelCoorSoft(0, 40,0);
+        State::getCameraTargetNode()->setParentSoft(this->travelNode);
+        State::getCameraTargetNode()->setRelCoorSoft(5,0,0);
+
+        this->debugNode(1);
+        this->travelNode->debugNode(1);
+        std::cout << "testprint";
+      }
+      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)
 {
-}
+    // 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->velocity.x >= 0)
+    {
+      if (this->velocity.x > 2*this->acceleration * dt)
+        this->velocity.x -= 2* this->acceleration * dt;
+      else
+        this->velocity.x = 0;
+    }
+    else
+    {
+      if (this->velocity.x < -2*this->acceleration * dt)
+        this->velocity.x += 2* this->acceleration * dt;
+      else
+        this->velocity.x = 0;
+    }
+
+  if( this->bForward )
+  {
+    if(this->getRelCoor().x < this->travelDistance.x)
+    {
+      if (this->velocity.x < this->travelSpeed)
+      {
+        this->velocity.x += 3*this->acceleration*dt;
+      }
+      else
+      {
+        this->velocity.x = this->travelSpeed;
+      }
+    }
+    else
+    {
+      this->velocity.x = 0.0f;
+    }
+  }
+
+  if( this->bBackward )
+  {
+    if(this->getRelCoor().x > -this->travelDistance.x)
+    {
+      if (this->velocity.x > -this->travelSpeed)
+      {
+        this->velocity.x -= 3*this->acceleration*dt;
+      }
+      else
+      {
+        this->velocity.x = -this->travelSpeed;
+      }
+    }
+    else
+    {
+      this->velocity.x = 0.0f;
+    }
+  }
+  if( this->bLeft)
+  {
+  }
+
+  if( this->bRight)
+  {
+  }
+
+  switch(this->getPlaymode())
+  {
+    case Playable::Full3D:
+    /*
+      {
+        Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);
+
+        // this is the air friction (necessary for a smooth control)
+        Vector damping = (this->velocity * this->airFriction);
+
+
+        this->velocity += (accelerationDir - damping)* dt;
+        this->shiftCoor (this->velocity * dt);
+
+        // limit the maximum rotation speed.
+        if (this->rotation != 0.0f)
+        {
+          float maxRot = 10.0 * dt;
+          if (unlikely(this->rotation > maxRot)) this->rotation = maxRot;
+          if (unlikely(this->rotation < -maxRot)) this->rotation = -maxRot;
+          this->direction *= Quaternion(-M_PI/4.0*this->rotation, Vector(0,1,0));
+
+          this->rotation = 0.0f;
+        }
+
+        this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
+      }
+      break;
+    */
+    case Playable::Vertical:
+      {
+        /*
+        if (this->toTravelHeight != NULL)
+        {
+          this->travelNode->shiftCoor(Vector(0, (*toTravelHeight - this->travelNode->getAbsCoor().y) * dt * 10.0, 0));
+          if (fabsf(this->travelNode->getAbsCoor().y - *this->toTravelHeight) < .1)
+          {
+            delete this->toTravelHeight;
+            this->toTravelHeight = NULL;
+          }
+        }
+        */
+        this->travelNode->shiftCoor(Vector(this->cameraSpeed * dt, 0, 0));
+
+        /*
+        accel.y = 0.0;
+
+        Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);
+        accelerationDir.y = 0.0;
+
+        // this is the air friction (necessary for a smooth control)
+        Vector damping = (this->velocity * this->airFriction);
+
+
+        this->velocity += (accelerationDir - damping)* dt;
+
+        if (this->getRelCoor().z > this->travelDistance.y && velocity.z > 0.0)
+          this->velocity.z = 0.0f;
+        if (this->getRelCoor().z < -this->travelDistance.y && velocity.z < 0.0)
+          this->velocity.z = 0.0f;
+
+        if (this->getRelCoor().x > this->travelDistance.x && velocity.x > 0.0)
+          this->velocity.x = 0.0f;
+        if (this->getRelCoor().x < -this->travelDistance.x && velocity.x < 0.0)
+          this->velocity.x = 0.0f;
+
+        */
+        this->shiftCoor (this->velocity * dt);
+   
+
+        /*
+        if (accel.z == 0)
+          this->setRelDirSoft(Quaternion(0, Vector(0,0,0)), 5.0f);
+        else
+          this->setRelDirSoft(Quaternion(this->velocity.z * 5, Vector(1,0,0)), 4.5f);
+        */
+      }
+      break;
+
+    default:
+      PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName());
+  }
+}
+
Index: branches/playability/src/world_entities/space_ships/space_ship.h
===================================================================
--- branches/playability/src/world_entities/space_ships/space_ship.h	(revision 10016)
+++ branches/playability/src/world_entities/space_ships/space_ship.h	(revision 10017)
@@ -35,5 +35,5 @@
     void setTravelDistance(float x, float y);
 
-    void setAirFriction(float friction) { this->airFriction = friction; };
+    //void setAirFriction(float friction) { this->airFriction = friction; };
 
     virtual void enter();
@@ -121,6 +121,6 @@
     int         curWeaponSecondary; //!< current secondary weapon config
 
-    bool                  bUp;                //!< up button pressed.
-    bool                  bDown;              //!< down button pressed.
+    bool                  bForward;                //!< up button pressed.
+    bool                  bBackward;              //!< down button pressed.
     bool                  bLeft;              //!< left button pressed.
     bool                  bRight;             //!< right button pressed.
@@ -131,4 +131,5 @@
     bool                  bRollR;             //!< rolling button pressed (right)
 
+    /*
     float                 xMouse;             //!< mouse moved in x-Direction
     float                 yMouse;             //!< mouse moved in y-Direction
@@ -137,12 +138,17 @@
     int                   controlVelocityX;
     int                   controlVelocityY;
-//    float                 cycle;              //!< hovercycle
+    */
+//   float                 cycle;              //!< hovercycle
+
 
     Vector                velocity;           //!< the velocity of the player.
-    Vector                oldVelocity;        //!< the velocity the player had last synced
+    //Vector                oldVelocity;        //!< the velocity the player had last synced
+
+
 
 // 2D-traveling
     PNode*                travelNode;
     float                 travelSpeed;        //!< the current speed of the Ship (to make soft movement)
+    Vector2D              travelDistance;     //!< Travel-Distance away from the TravelNode
 
 // Camera
@@ -150,19 +156,19 @@
     float                 cameraLook;
     float                 rotation;
+    float                 cameraSpeed;
 
-    // FIXME until other fixme removal needed
+    /*
     Quaternion            mouseDir;           //!< the direction where the player wants to fly
     Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
     float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
-
     Quaternion            rotQuat;
     Quaternion            pitchDir;
     float                 dogdeSpeed;        //!< the dogde Speed of the ship.
-    // FIXME
+    */
 
     Quaternion            direction;          //!< the direction of the ship.
     float                 acceleration;       //!< the acceleration of the ship.
-    float                 airFriction;        //!< AirFriction.
-    float                 airViscosity;
+    //float                 airFriction;        //!< AirFriction.
+    //float                 airViscosity;
 
     byte                  oldMask;            //!< used for synchronisation
