Index: /code/branches/steering/src/orxonox.cc
===================================================================
--- /code/branches/steering/src/orxonox.cc	(revision 316)
+++ /code/branches/steering/src/orxonox.cc	(revision 317)
@@ -79,56 +79,93 @@
 using namespace Ogre;
 
-class OrxExitListener : public FrameListener
+class OrxExitListener : public FrameListener, public OIS::MouseListener
 {
   public:
-    OrxExitListener(OIS::Keyboard *keyboard)
-  : mKeyboard(keyboard)
-    {
-    }
-
+    OrxExitListener(OIS::Keyboard *keyboard, OIS::Mouse *mouse)
+  : mKeyboard(keyboard), mMouse(mouse)
+    {
+      speed = 250;
+      loop = 100;
+      rotate = 10;
+      mouseX = 0;
+      mouseY = 0;
+      maxMouseX = 0;
+      minMouseX = 0;
+      moved = false;
+      steering->brakeRotate(rotate*10);
+      steering->brakeLoop(loop);
+      mMouse->setEventCallback(this);
+    }
     bool frameStarted(const FrameEvent& evt)
     {
-      float speed = 1;
-      float rotate = 1;
       mKeyboard->capture();
-      if (mKeyboard->isKeyDown(OIS::KC_SPACE))
+      mMouse->capture();
+      if (mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W))
         steering->moveForward(speed);
       else
         steering->moveForward(0);
-      if(mKeyboard->isKeyDown(OIS::KC_C))
-        steering->brake(speed);
+      if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S))
+        steering->brakeForward(speed);
       else
-        steering->brake(0.1);
-      if (mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W))
-        steering->rotateUp(rotate);
-      else
-        steering->rotateUp(0);
-      if (mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S))
-        steering->rotateDown(rotate);
-      else
-        steering->rotateDown(0);
+        steering->brakeForward(speed/10);
       if (mKeyboard->isKeyDown(OIS::KC_RIGHT) || mKeyboard->isKeyDown(OIS::KC_D))
-        steering->rotateRight(rotate);
-      else
-        steering->rotateRight(0);
-      if (mKeyboard->isKeyDown(OIS::KC_LEFT) || mKeyboard->isKeyDown(OIS::KC_A))
-        steering->rotateLeft(rotate);
-      else
-        steering->rotateLeft(0);
-      if (mKeyboard->isKeyDown(OIS::KC_E))
-        steering->loopRight(rotate);
+        steering->loopRight(loop);
       else
         steering->loopRight(0);
-      if (mKeyboard->isKeyDown(OIS::KC_Q))
-        steering->loopLeft(rotate);
+      if (mKeyboard->isKeyDown(OIS::KC_LEFT) || mKeyboard->isKeyDown(OIS::KC_A))
+        steering->loopLeft(loop);
       else
         steering->loopLeft(0);
+
+      if(moved) {
+        if (mouseY<0)
+          steering->rotateUp(-mouseY*rotate);
+        if (mouseY>0)
+          steering->rotateDown(mouseY*rotate);
+        if (mouseX>0)
+          steering->rotateRight(mouseX*rotate);
+        if (mouseX<0)
+          steering->rotateLeft(-mouseX*rotate);
+        moved = false;
+      }
+      else {
+        steering->rotateUp(0);
+        steering->rotateDown(0);
+        steering->rotateRight(0);
+        steering->rotateLeft(0);
+      }
+
       steering->tick(evt.timeSinceLastFrame);
 //	scenemanager->spacehip->tick(evt.timesincelastframe);
+      if(mKeyboard->isKeyDown(OIS::KC_ESCAPE))
+        cout << "maximal MouseX: " << maxMouseX << "\tminMouseX: " << minMouseX << endl;
       return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
     }
 
+    bool mouseMoved(const OIS::MouseEvent &e)
+    {
+      mouseX = e.state.X.rel;
+      mouseY = e.state.Y.rel;
+      if(mouseX>maxMouseX) maxMouseX = mouseX;
+      if(mouseX<minMouseX) minMouseX = mouseX;
+      cout << "mouseX: " << mouseX << "\tmouseY: " << mouseY << endl;
+      moved = true;
+      return true;
+    }
+
+    bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; }
+    bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; }
+
   private:
+    float speed;
+    float rotate;
+    float loop;
+    float mouseY;
+    float mouseX;
+    float maxMouseX;
+    float minMouseX;
+    bool moved;
     OIS::Keyboard *mKeyboard;
+    OIS::Mouse *mMouse;
 };
 
@@ -286,5 +323,5 @@
       {
         mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false));
-        mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, false));
+        mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
       }
       catch (const OIS::Exception &e)
@@ -308,5 +345,5 @@
     void createFrameListener()
     {
-      mListener = new OrxExitListener(mKeyboard);
+      mListener = new OrxExitListener(mKeyboard, mMouse);
       mRoot->addFrameListener(mListener);      
     }
Index: /code/branches/steering/src/spaceship_steering.cc
===================================================================
--- /code/branches/steering/src/spaceship_steering.cc	(revision 316)
+++ /code/branches/steering/src/spaceship_steering.cc	(revision 317)
@@ -7,5 +7,4 @@
 maxSpeedLoopRightLeft) {
   moveForward_ = 0;
-  brake_ = 0;
   rotateUp_ = 0;
   rotateDown_ = 0;
@@ -14,4 +13,7 @@
   loopRight_ = 0;
   loopLeft_ = 0;
+  brakeForward_ = 0;
+  brakeRotate_ = 0;
+  brakeLoop_ = 0;
   speedForward_ = 0;
   speedRotateUpDown_ = 0;
@@ -33,12 +35,12 @@
     accelerationForward_ = moveForward_;
     if(speedForward_ < maxSpeedForward_)
-      speedForward_ += accelerationForward_;
+      speedForward_ += accelerationForward_*time;
     if(speedForward_ > maxSpeedForward_)
       speedForward_ = maxSpeedForward_;
   }
-  else {
-    accelerationForward_ = brake_;
+  if(moveForward_ <= 0) {
+    accelerationForward_ = brakeForward_;
     if(speedForward_ > 0)
-      speedForward_ -= accelerationForward_;
+      speedForward_ -= accelerationForward_*time;
     if(speedForward_ < 0)
       speedForward_ = 0;
@@ -48,20 +50,21 @@
     accelerationRotateUpDown_ = rotateUp_;
     if(speedRotateUpDown_ < maxSpeedRotateUpDown_)
-      speedRotateUpDown_ += accelerationRotateUpDown_;
+      speedRotateUpDown_ += accelerationRotateUpDown_*time;
     if(speedRotateUpDown_ > maxSpeedRotateUpDown_)
       speedRotateUpDown_ = maxSpeedRotateUpDown_;
   }
-  else if(rotateDown_ > 0) {
+  if(rotateDown_ > 0) {
     accelerationRotateUpDown_ = rotateDown_;
     if(speedRotateUpDown_ > -maxSpeedRotateUpDown_)
-      speedRotateUpDown_ -= accelerationRotateUpDown_;
+      speedRotateUpDown_ -= accelerationRotateUpDown_*time;
     if(speedRotateUpDown_ < -maxSpeedRotateUpDown_)
       speedRotateUpDown_ = -maxSpeedRotateUpDown_;
   }
-  else {
+  if(rotateUp_ == 0 && rotateDown_ == 0) {
+    accelerationRotateUpDown_ = brakeRotate_;
     if(speedRotateUpDown_ > 0)
-      speedRotateUpDown_ -= accelerationRotateUpDown_;
+      speedRotateUpDown_ -= accelerationRotateUpDown_*time;
     if(speedRotateUpDown_ < 0)
-      speedRotateUpDown_ += accelerationRotateUpDown_;
+      speedRotateUpDown_ += accelerationRotateUpDown_*time;
   }
 
@@ -69,20 +72,21 @@
     accelerationRotateRightLeft_ = rotateRight_;
     if(speedRotateRightLeft_ > -maxSpeedRotateRightLeft_)
-      speedRotateRightLeft_ -= accelerationRotateRightLeft_;
+      speedRotateRightLeft_ -= accelerationRotateRightLeft_*time;
     if(speedRotateRightLeft_ < -maxSpeedRotateRightLeft_)
       speedRotateRightLeft_ = -maxSpeedRotateRightLeft_;
   }
-  else if(rotateLeft_ > 0) {
+  if(rotateLeft_ > 0) {
     accelerationRotateRightLeft_ = rotateLeft_;
     if(speedRotateRightLeft_ < maxSpeedRotateRightLeft_)
-      speedRotateRightLeft_ += accelerationRotateRightLeft_;
+      speedRotateRightLeft_ += accelerationRotateRightLeft_*time;
     if(speedRotateRightLeft_ > maxSpeedRotateRightLeft_)
       speedRotateRightLeft_ = maxSpeedRotateRightLeft_;
   }
-  else {
+  if(rotateRight_ == 0 && rotateLeft_ == 0) {
+    accelerationRotateRightLeft_ = brakeRotate_;
     if(speedRotateRightLeft_ > 0)
-      speedRotateRightLeft_ -= accelerationRotateRightLeft_;
+      speedRotateRightLeft_ -= accelerationRotateRightLeft_*time;
     if(speedRotateRightLeft_ < 0)
-      speedRotateRightLeft_ += accelerationRotateRightLeft_;
+      speedRotateRightLeft_ += accelerationRotateRightLeft_*time;
   }
 
@@ -90,20 +94,21 @@
     accelerationLoopRightLeft_ = loopRight_;
     if(speedLoopRightLeft_ < maxSpeedLoopRightLeft_)
-      speedLoopRightLeft_ += accelerationLoopRightLeft_;
+      speedLoopRightLeft_ += accelerationLoopRightLeft_*time;
     if(speedLoopRightLeft_ > maxSpeedLoopRightLeft_)
       speedLoopRightLeft_ = maxSpeedLoopRightLeft_;
   }
-  else if(loopLeft_ > 0) {
+  if(loopLeft_ > 0) {
     accelerationLoopRightLeft_ = loopLeft_;
     if(speedLoopRightLeft_ > -maxSpeedLoopRightLeft_)
-      speedLoopRightLeft_ -= accelerationLoopRightLeft_;
+      speedLoopRightLeft_ -= accelerationLoopRightLeft_*time;
     if(speedLoopRightLeft_ < -maxSpeedLoopRightLeft_)
       speedLoopRightLeft_ = -maxSpeedLoopRightLeft_;
   }
-  else {
+  if(loopLeft_ == 0 && loopRight_ == 0) {
+    accelerationLoopRightLeft_ = brakeLoop_;
     if(speedLoopRightLeft_ > 0)
-      speedLoopRightLeft_ -= accelerationLoopRightLeft_;
+      speedLoopRightLeft_ -= accelerationLoopRightLeft_*time;
     if(speedLoopRightLeft_ < 0)
-      speedLoopRightLeft_ += accelerationLoopRightLeft_;
+      speedLoopRightLeft_ += accelerationLoopRightLeft_*time;
   }
 
@@ -123,8 +128,4 @@
 void SpaceshipSteering::moveForward(float moveForward) {
   moveForward_ = moveForward;
-}
-
-void SpaceshipSteering::brake(float brake) {
-  brake_ = brake;
 }
 
@@ -153,4 +154,16 @@
 }
 
+void SpaceshipSteering::brakeForward(float brakeForward) {
+  brakeForward_ = brakeForward;
+}
+
+void SpaceshipSteering::brakeRotate(float brakeRotate) {
+  brakeRotate_ = brakeRotate;
+}
+
+void SpaceshipSteering::brakeLoop(float brakeLoop) {
+  brakeLoop_ = brakeLoop;
+}
+
 void SpaceshipSteering::maxSpeedForward(float maxSpeedForward) {
   maxSpeedForward_ = maxSpeedForward;
Index: /code/branches/steering/src/spaceship_steering.h
===================================================================
--- /code/branches/steering/src/spaceship_steering.h	(revision 316)
+++ /code/branches/steering/src/spaceship_steering.h	(revision 317)
@@ -11,5 +11,4 @@
     void tick(float time);
     void moveForward(float moveForward);
-    void brake(float brake);
     void rotateUp(float rotateUp);
     void rotateDown(float rotateDown);
@@ -18,4 +17,7 @@
     void loopRight(float loopRight);
     void loopLeft(float loopLeft);
+    void brakeForward(float brakeForward);
+    void brakeRotate(float brakeRotate);
+    void brakeLoop(float brakeLoop);
     void maxSpeedForward(float maxSpeedForward);
     void maxSpeedRotateUpDown(float maxSpeedRotateUpDown);
@@ -29,5 +31,4 @@
   private:
     float moveForward_;
-    float brake_;
     float rotateUp_;
     float rotateDown_;
@@ -36,4 +37,7 @@
     float loopRight_;
     float loopLeft_;
+    float brakeForward_;
+    float brakeRotate_;
+    float brakeLoop_;
 
     float speedForward_;
