Index: code/branches/main_reto_vs05/src/ogre_control.cc
===================================================================
--- code/branches/main_reto_vs05/src/ogre_control.cc	(revision 157)
+++ code/branches/main_reto_vs05/src/ogre_control.cc	(revision 159)
@@ -26,7 +26,19 @@
  */
 
+/**
+* Ogre control class.
+* This is merely a convenient way to handle Ogre. It only holds the Root
+* object and the render Window. These are the objects, that are independant
+* of the game state (playing, menu browsing, loading, etc.).
+* This class could easily be merged into the Orxnox class.
+*/
+
+
 #include "ogre_control.h"
 
 
+/**
+* Provide support for mac users.
+*/
 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
 // This function will locate the path to our application on OS X,
@@ -56,7 +68,9 @@
 
 
-OgreControl::OgreControl()
-{
-	mRoot = 0;
+/**
+* Constructor that determines the resource path platform dependant.
+*/
+OgreControl::OgreControl() : root_(0)
+{
 	// Provide a nice cross platform solution for locating the configuration
 	// files. On windows files are searched for in the current working
@@ -64,21 +78,26 @@
   // function macBundlePath does this for us.
 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-	mResourcePath = macBundlePath() + "/Contents/Resources/";
+	resourcePath_ = macBundlePath() + "/Contents/Resources/";
 #else
-	mResourcePath = "";
-#endif
-}
-
-
-// standard destructor
+	resourcePath_ = "";
+#endif
+}
+
+
+/**
+* Standard Destructor.
+*/
 OgreControl::~OgreControl()
 {
-	if (mRoot)
-		delete mRoot;
-}
-
-
-/**------------- SETTING UP OGRE --------------**/
-
+	if (root_)
+		delete root_;
+}
+
+
+/* Sets up Ogre.
+* First, the Root object is being created, then the resources are defined
+* (not loaded!). And last but not least, the render settings (like resolution
+* or AA level) are prompted to the user.
+*/
 bool OgreControl::initialise(void)
 {
@@ -86,9 +105,9 @@
 	// only use plugins.cfg if not static
 #ifndef OGRE_STATIC_LIB
-	pluginsPath = mResourcePath + "plugins.cfg";
-#endif
-
-	mRoot = new Root(pluginsPath, 
-		mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
+	pluginsPath = resourcePath_ + "plugins.cfg";
+#endif
+
+	root_ = new Root(pluginsPath, 
+		resourcePath_ + "ogre.cfg", resourcePath_ + "Ogre.log");
 
 	setupResources();
@@ -101,11 +120,12 @@
 
 
-// Method which will define the source of resources
-// (other than current folder)
+/**
+* Defines the source of the resources.
+*/
 void OgreControl::setupResources(void)
 {
 	// Load resource paths from config file
 	ConfigFile cf;
-	cf.load(mResourcePath + "resources.cfg");
+	cf.load(resourcePath_ + "resources.cfg");
 
 	// Go through all sections & settings in the file
@@ -137,4 +157,9 @@
 
 
+/**
+* Prompts a setting window for the render engine if that has not already
+* been done.
+* The method also calls the root initialiser in order to get a render window.
+*/
 bool OgreControl::configure(void)
 {
@@ -142,5 +167,5 @@
 	// You can skip this and use root.restoreConfig() to load configuration
 	// settings if you were sure there are valid ones saved in ogre.cfg
-	if(!mRoot->restoreConfig() && !mRoot->showConfigDialog())
+	if(!root_->restoreConfig() && !root_->showConfigDialog())
 		return false;
 
@@ -148,24 +173,36 @@
 	// Here we choose to let the system create a default
   // rendering window by passing 'true'
-	mWindow = mRoot->initialise(true);
-	mRoot->saveConfig();
+	root_->saveConfig();
+	window_ = root_->initialise(true);
 	return true;
 }
 
 
+/**
+* Returns the root object.
+* @return Root object.
+*/
 Root* OgreControl::getRoot(void)
 {
-	return mRoot;
-}
-
-
+	return root_;
+}
+
+
+/**
+* Returns the render window.
+* @return Render window.
+*/
 RenderWindow* OgreControl::getRenderWindow(void)
 {
-	return mWindow;
-}
-
-
+	return window_;
+}
+
+
+/**
+* Returns the resource path.
+* @return Resource path.
+*/
 Ogre::String OgreControl::getResourcePath(void)
 {
-	return mResourcePath;
-}
+	return resourcePath_;
+}
Index: code/branches/main_reto_vs05/src/orxonox.cc
===================================================================
--- code/branches/main_reto_vs05/src/orxonox.cc	(revision 157)
+++ code/branches/main_reto_vs05/src/orxonox.cc	(revision 159)
@@ -26,8 +26,33 @@
  */
 
+/**
+* Basic part of the game.
+* It sets up Ogre and most important of all: Orxonox is the master of the
+* main loop and therefore time itself.
+*/
+
 
 #include "orxonox.h"
 
 
+/**
+* Empty Constructor.
+*/
+Orxonox::Orxonox()
+{
+}
+
+
+/**
+* Empty Destructor.
+*/
+Orxonox::~Orxonox()
+{
+}
+
+
+/**
+* Starts and runs the game
+*/
 void Orxonox::go(void)
 {
@@ -35,7 +60,7 @@
 		return;
 
-	mTimer = new Timer();
+	timer_ = new Timer();
 
-	unsigned long lastTime = mTimer->getMilliseconds();
+	unsigned long lastTime = timer_->getMilliseconds();
 
 	while (true)
@@ -44,10 +69,10 @@
 		WindowEventUtilities::messagePump();
 
-		mOgre->getRoot()->renderOneFrame();
+		ogre_->getRoot()->renderOneFrame();
 
-		if (!mRunMgr->tick(mTimer->getMilliseconds(),
-            (mTimer->getMilliseconds() - lastTime) / 1000.0))
+		if (!runMgr_->tick(timer_->getMilliseconds(),
+            (timer_->getMilliseconds() - lastTime) / 1000.0))
 			break;
-		lastTime = mTimer->getMilliseconds();
+		lastTime = timer_->getMilliseconds();
 	}
 
@@ -57,11 +82,15 @@
 
 
+/**
+* Create render engine, render window and the Run manager.
+* @return False if failed.
+*/
 bool Orxonox::setup(void)
 {
 	// create new 3D ogre render engine
-	mOgre = new OgreControl();
-	mOgre->initialise();
+	ogre_ = new OgreControl();
+	ogre_->initialise();
 
-	mRunMgr = new RunManager(mOgre);
+	runMgr_ = new RunManager(ogre_);
 
 	return true;
@@ -69,11 +98,14 @@
 
 
+/**
+* Clean everything up.
+*/
 void Orxonox::destroy()
 {
-	if (mTimer)
-		delete mTimer;
-	if (mRunMgr)
-		delete mRunMgr;
-	if (mOgre)
-		delete mOgre;
+	if (timer_)
+		delete timer_;
+	if (runMgr_)
+		delete runMgr_;
+	if (ogre_)
+		delete ogre_;
 }
Index: code/branches/main_reto_vs05/src/orxonox_scene.cc
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_scene.cc	(revision 157)
+++ code/branches/main_reto_vs05/src/orxonox_scene.cc	(revision 159)
@@ -26,17 +26,34 @@
  */
 
+/**
+* The orxonox scene includes everything running in the background like terrain,
+* static figures, dangling lamp, etc.
+*/
+
+
 #include "orxonox_scene.h"
 
 
-OrxonoxScene::OrxonoxScene(SceneManager *mSceneMgr) : mSceneMgr(mSceneMgr)
+/**
+* Empty Consructor except the initialiser list.
+* @param sceneMgr The Scene Manager.
+*/
+OrxonoxScene::OrxonoxScene(SceneManager *sceneMgr) : sceneMgr_(sceneMgr)
 {
 }
 
-
+/**
+* Empty Destructor.
+*/
 OrxonoxScene::~OrxonoxScene()
 {
 }
 
-
+/**
+* Ogre initialisation method.
+* This function is called by the Run Manager to load the neccessary recources
+* and to create the scene.
+* @return False if failed.
+*/
 bool OrxonoxScene::initialise()
 {
@@ -44,6 +61,6 @@
 	loadResources();
 
-	distance = 0;
-	radius = 100;
+	distance_ = 0;
+	radius_ = 100;
 
 	createScene();
@@ -53,8 +70,10 @@
 
 
-// method where you can perform resource group loading
-// Must at least do
-// ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-void OrxonoxScene::loadResources(void)
+/**
+* Resource loader.
+* Currently, this method loads everything! TODO: If done this ugly, it should
+* at least be in the Run Manager.
+*/
+void OrxonoxScene::loadResources()
 {
 	// Initialise, parse scripts etc
@@ -63,14 +82,17 @@
 
 
-// Currently just a test scene with an ogre head an a surrounding light
-void OrxonoxScene::createScene(void)
+/**
+* Scene creation.
+* Currently just a test scene with an ogre head an a surrounding light.
+*/
+void OrxonoxScene::createScene()
 {
-	mSceneMgr->setAmbientLight(ColourValue(0.3,0.3,0.3));
+	sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3));
 
 	//create first entity
-	Entity *head = mSceneMgr->createEntity("head", "ogrehead.mesh");
+	Entity *head = sceneMgr_->createEntity("head", "ogrehead.mesh");
 
 	//create a scene node to attach the head to
-	SceneNode *node = mSceneMgr->getRootSceneNode()
+	SceneNode *node = sceneMgr_->getRootSceneNode()
         ->createChildSceneNode("OgreHeadNode", Vector3(0,0,0));
 	//attach the ogre head
@@ -78,37 +100,44 @@
 
 	// set up skybox
-	mSceneMgr->setSkyBox(true, "Examples/SceneSkyBox2");
+	sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox2");
 
-	// set up one mLight source
-	mLight = mSceneMgr->createLight("Light1");
-	mLight->setType(Light::LT_POINT);
-	mLight->setPosition(Vector3(0, 0, 0));
-	mLight->setDiffuseColour(1.0, 1.0, 1.0);
-	mLight->setSpecularColour(1.0, 1.0, 1.0);
+	// set up one light_ source
+	light_ = sceneMgr_->createLight("Light1");
+	light_->setType(Light::LT_POINT);
+	light_->setPosition(Vector3(0, 0, 0));
+	light_->setDiffuseColour(1.0, 1.0, 1.0);
+	light_->setSpecularColour(1.0, 1.0, 1.0);
 
 	//create billboard
-	bbs = mSceneMgr->createBillboardSet("bb", 1);
-	bbs->createBillboard(Vector3::ZERO, ColourValue(1.0, 1.0, 1.0));
-	bbs->setMaterialName("Examples/Flare");
+	bbs_ = sceneMgr_->createBillboardSet("bb", 1);
+	bbs_->createBillboard(Vector3::ZERO, ColourValue(1.0, 1.0, 1.0));
+	bbs_->setMaterialName("Examples/Flare");
 
-	lightNode = mSceneMgr->getRootSceneNode()
-        ->createChildSceneNode("LightNode", Vector3(0, 100, 0));
+	lightNode_ = sceneMgr_->getRootSceneNode()
+        ->createChildSceneNode("lightNode_", Vector3(0, 100, 0));
 
-	lightNode->attachObject(bbs);
-	lightNode->attachObject(mLight);
+	lightNode_->attachObject(bbs_);
+	lightNode_->attachObject(light_);
 }
 
 
-// compute something between frames if neccessary
-void OrxonoxScene::tick(unsigned long time, float deltaTime)
+/**
+* Compute something between frames if neccessary.
+* @param time Absolute time.
+* @param deltaTime Relative time.
+* @return Return true to continue rendering.
+*/
+bool OrxonoxScene::tick(unsigned long time, Real deltaTime)
 {
-	float t = time/1000.0;
+	Real t = time/1000.0;
 
-	lightNode->setPosition(radius*sin(5*t), radius*cos(5*t), sin(1*t)*distance);
+	lightNode_->setPosition(radius_*sin(5*t), radius_*cos(5*t), sin(1*t)*distance_);
 	
-	mLight->setDiffuseColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
-	mLight->setSpecularColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
+	light_->setDiffuseColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
+	light_->setSpecularColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
 
-	bbs->getBillboard(0)->setColour(ColourValue(sin(1*t),
+	bbs_->getBillboard(0)->setColour(ColourValue(sin(1*t),
         sin(1*t + 2.09), sin(1*t + 2.09*2)));
+  
+  return true;
 }
Index: code/branches/main_reto_vs05/src/orxonox_ship.cc
===================================================================
--- code/branches/main_reto_vs05/src/orxonox_ship.cc	(revision 157)
+++ code/branches/main_reto_vs05/src/orxonox_ship.cc	(revision 159)
@@ -50,8 +50,8 @@
 * @param mNode The scene node which the ship will be attached to later.
 */
-OrxonoxShip::OrxonoxShip(SceneManager *mSceneMgr, SceneNode *mNode)
-	    : mSceneMgr(mSceneMgr), mRootNode(mNode), speed(Vector3(0, 0, 0)),
-      baseThrust(1000), thrust(0), sideThrust(0), n(0),
-	bulletSpeed(400)
+OrxonoxShip::OrxonoxShip(SceneManager *sceneMgr, SceneNode *node)
+	    : sceneMgr_(sceneMgr), rootNode_(node), currentSpeed_(Vector3(0, 0, 0)),
+      baseThrust_(1000), currentThrust_(Vector3::ZERO),
+      objectCounter_(0), bulletSpeed_(400)
 {
 }
@@ -72,4 +72,5 @@
 * It might be an idea to make this function static in order for the
 * SceneManger to call the initialise method of every needed class (macros..)
+* @return Returns false when failed.
 */
 bool OrxonoxShip::initialise()
@@ -81,8 +82,8 @@
 	// create the "space ship" (currently a fish..)
 	// TODO: names must be unique! use static variables..
-	mShip = mSceneMgr->createEntity("Ship", "fish.mesh");
-	SceneNode *fishNode = mRootNode->createChildSceneNode("fishNode");
+	shipEntity_ = sceneMgr_->createEntity("Ship", "fish.mesh");
+	SceneNode *fishNode = rootNode_->createChildSceneNode("fishNode");
 	fishNode->yaw(Degree(-90));
-	fishNode->attachObject(mShip);
+	fishNode->attachObject(shipEntity_);
 	fishNode->setScale(Vector3(10, 10, 10));
 
@@ -96,7 +97,8 @@
 * @param value Acceleration between 0 and 1
 */
-void OrxonoxShip::setThrust(const Real value)
-{
-	thrust = value * baseThrust;
+void OrxonoxShip::setMainThrust(const Real value)
+{
+	//currentThrust_ = value * baseThrust_;
+  currentThrust_.z = value * baseThrust_;
 }
 
@@ -109,5 +111,18 @@
 void OrxonoxShip::setSideThrust(const Real value)
 {
-	sideThrust = value * baseThrust;
+	//currentSideThrust_ = value * baseThrust_;
+  currentThrust_.x = value * baseThrust_;
+}
+
+
+/**
+* Gets the ship to accelerate up and down.
+* The value should be between 0 and 1, with one beeing full thrust and 0 none.
+* @param value Acceleration between 0 and 1
+*/
+void OrxonoxShip::setYThrust(const Real value)
+{
+  //currentYThrust_ = value * baseThrust_;
+  currentThrust_.y = value * baseThrust_;
 }
 
@@ -119,5 +134,5 @@
 void OrxonoxShip::turnUpAndDown(const Radian &angle)
 {
-  RootNode_->pitch(angle, Ogre::Node::TransformSpace::TS_LOCAL);
+  rootNode_->pitch(-angle, Node::TS_LOCAL);
 }
 
@@ -129,5 +144,24 @@
 void OrxonoxShip::turnLeftAndRight(const Radian &angle)
 {
-  RootNode_->yaw(angle, Ogre::Node::TransformSpace::TS_PARENT);
+  rootNode_->yaw(-angle, Node::TS_PARENT);
+}
+
+
+/**
+* Returns the current speed of the ship according to its parent node.
+* @return The current speed.
+*/
+Vector3 OrxonoxShip::getSpeed()
+{
+  return currentSpeed_;
+}
+
+/**
+* Returns the ship's root SceneNode.
+* @return The Root Node.
+*/
+SceneNode* OrxonoxShip::getRootNode()
+{
+  return rootNode_;
 }
 
@@ -137,17 +171,18 @@
 * This method creates a new Entity plus a SceneNode. But be sure not make
 * the new Node a child of RootNode_!
+* @return Bullet containing speed and entity.
 */
 Bullet* OrxonoxShip::fire()
 {
 	// TODO: Names must be unique!
-	SceneNode *temp = RootNode_->getParentSceneNode()->createChildSceneNode(
+	SceneNode *temp = rootNode_->getParentSceneNode()->createChildSceneNode(
         "BulletNode" + StringConverter::toString(objectCounter_));
-	temp->setOrientation(RootNode_->getOrientation());
-	temp->setPosition(RootNode_->getPosition());
+	temp->setOrientation(rootNode_->getOrientation());
+	temp->setPosition(rootNode_->getPosition());
 	temp->setScale(Vector3(1, 1, 1) * 10);
 	temp->yaw(Degree(-90));
-	return new Bullet(temp, mSceneMgr->createEntity("bullet"
-        + StringConverter::toString(objectCounter_++), "Barrel.mesh"), speed
-        + (RootNode_->getOrientation() * Vector3(0, 0, -1)).normalisedCopy()
+	return new Bullet(temp, sceneMgr_->createEntity("bullet"
+        + StringConverter::toString(objectCounter_++), "Barrel.mesh"), currentSpeed_
+        + (rootNode_->getOrientation() * Vector3(0, 0, -1)).normalisedCopy()
         * bulletSpeed_);
 }
@@ -159,13 +194,15 @@
 * @param time Absolute time.
 * @param deltaTime Relative time.
+* @return Return true to continue render
 */
 bool OrxonoxShip::tick(unsigned long time, Real deltaTime)
 {
-  Quaternion quad = mRootNode->getOrientation();
+  Quaternion quad = rootNode_->getOrientation();
   quad.normalise();
-  speed += quad * Vector3(0, 0, -1) * currentThrust_ * deltaTime;
-	speed += quad * Vector3(-1, 0,  0) * current_SideThrust_ * deltaTime;
-
-	RootNode_->translate(currentSpeed_ * deltaTime);
+  currentSpeed_ += quad * (Vector3(-1, -1, -1) * currentThrust_) * deltaTime;
+  //currentSpeed_ += quad * Vector3(0, 0, -1) * currentThrust_ * deltaTime;
+	//currentSpeed_ += quad * Vector3(-1, 0,  0) * currentSideThrust_ * deltaTime;
+
+	rootNode_->translate(currentSpeed_ * deltaTime);
 
 	return true;
Index: code/branches/main_reto_vs05/src/run_manager.cc
===================================================================
--- code/branches/main_reto_vs05/src/run_manager.cc	(revision 157)
+++ code/branches/main_reto_vs05/src/run_manager.cc	(revision 159)
@@ -54,4 +54,5 @@
       statsOn_(true), screenShotCounter_(0), timeUntilNextToggle_(0),
       filtering_(TFO_BILINEAR), aniso_(1), sceneDetailIndex_(0),
+      mouseSensitivity_(0.003),
       debugOverlay_(0), inputManager_(0), mouse_(0), keyboard_(0), joystick_(0)
 {
@@ -80,5 +81,5 @@
 
   // Construct a new spaceship and give it the node
-  playerShip_ = new OrxonoxShip(sceneMgr_, getRootSceneNode()
+  playerShip_ = new OrxonoxShip(sceneMgr_, sceneMgr_->getRootSceneNode()
     ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)));
 
@@ -304,9 +305,16 @@
 
   if(keyboard_->isKeyDown(KC_UP) || keyboard_->isKeyDown(KC_W) )
-    playerShip_->setThrust(1);
+    playerShip_->setMainThrust(1);
   else if(keyboard_->isKeyDown(KC_DOWN) || keyboard_->isKeyDown(KC_S) )
-    playerShip_->setThrust(-1);
+    playerShip_->setMainThrust(-1);
   else
-    playerShip_->setThrust(0);
+    playerShip_->setMainThrust(0);
+
+  if (keyboard_->isKeyDown(KC_C))
+    playerShip_->setYThrust(1);
+  else if (keyboard_->isKeyDown(KC_SPACE))
+    playerShip_->setYThrust(-1);
+  else
+    playerShip_->setYThrust(0);
 
   if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) )
@@ -351,5 +359,5 @@
     window_->writeContentsToFile(ss.str());
     timeUntilNextToggle_ = 0.5;
-    mDebugText = "Saved: " + ss.str();
+    debugText_ = "Saved: " + ss.str();
   }
 
@@ -371,12 +379,12 @@
     timeUntilNextToggle_ = 0.5;
     if (!displayCameraDetails)
-      mDebugText = "";
+      debugText_ = "";
   }
 
   // Print camera details
   if(displayCameraDetails)
-    mDebugText = StringConverter::toString(playerShip_->getThrust())
-    + " | Speed = " + StringConverter::toString(playerShip_->speed);
-  // mDebugText = "P: " + StringConverter::toString(camera_
+    debugText_ = " | Speed = "
+          + StringConverter::toString(playerShip_->getSpeed());
+  // debugText_ = "P: " + StringConverter::toString(camera_
   //      ->getDerivedPosition()) + " " + "O: "
   //      + StringConverter::toString(camera_->getDerivedOrientation());
@@ -433,5 +441,5 @@
   // Simply give it the mouse movements.
   playerShip_->turnUpAndDown(Radian(ms.Y.rel * mouseSensitivity_));
-  playerShip_->turnLeftAndRight(Radian(ms.X.rel * mousSensitivity_));
+  playerShip_->turnLeftAndRight(Radian(ms.X.rel * mouseSensitivity_));
   //playerShip_->mRootNode->pitch(Degree(-ms.Y.rel * 0.13), Ogre::Node::TransformSpace::TS_LOCAL);
   //playerShip_->mRootNode->yaw(Degree(-ms.X.rel * 0.13), Ogre::Node::TransformSpace::TS_PARENT);
@@ -500,5 +508,5 @@
     OverlayElement* guiDbg = OverlayManager::getSingleton()
       .getOverlayElement("Core/DebugText");
-    guiDbg->setCaption(mDebugText);
+    guiDbg->setCaption(debugText_);
   }
   catch(...) { /* ignore */ }
@@ -516,8 +524,8 @@
 {
   camera_ = sceneMgr_->createCamera("PlayerCam");
-  playerShip_Node->attachObject(camera_);
+  playerShip_->getRootNode()->attachObject(camera_);
   camera_->setNearClipDistance(5);
   camera_->setPosition(Vector3(0,10,500));
-  camera_->lookAtVector3(0,0,0));
+  camera_->lookAt(Vector3(0,0,0));
 }
 
