Index: /code/branches/FICN/src/loader/LevelLoader.cc
===================================================================
--- /code/branches/FICN/src/loader/LevelLoader.cc	(revision 345)
+++ /code/branches/FICN/src/loader/LevelLoader.cc	(revision 346)
@@ -15,16 +15,16 @@
 	dir.append("/");
 	dir.append(file);	
-  	rootNode = XMLNode::openFileHelper(dir.c_str(),"WorldDataFile");
+  	rootNode = XMLNode::openFileHelper((const wchar_t*)dir.c_str(),(const wchar_t*)"WorldDataFile");
   	// TODO: Error handling
 
 	// Assing general level infos to class variables
-  	this->name_ = rootNode.getChildNode("name").getText();
-  	this->description_ = rootNode.getChildNode("description").getText();
-  	this->image_ = rootNode.getChildNode("image").getText();
+  	this->name_ = (const char*)rootNode.getChildNode((const wchar_t*)"name").getText();
+  	this->description_ = (const char*)rootNode.getChildNode((const wchar_t*)"description").getText();
+  	this->image_ = (const char*)rootNode.getChildNode((const wchar_t*)"image").getText();
   
   	this->loadingScreen();
   
   // Assign sub-nodes
-  if (rootNode.nChildNode("LightManager")==1)
+  if (rootNode.nChildNode((const wchar_t*)"LightManager")==1)
   {
   	// Init Luightmanager...
Index: /code/branches/FICN/src/loader/Light.cc
===================================================================
--- /code/branches/FICN/src/loader/Light.cc	(revision 345)
+++ /code/branches/FICN/src/loader/Light.cc	(revision 346)
@@ -9,4 +9,8 @@
 		
 	}
+
+  Light::~Light()
+  {
+  }
 	
 	Light::Light(XMLNode xml)
@@ -18,6 +22,6 @@
 	{
 		// Here comes the tricky part... convert strings to int
-		const char* diffuse = xml.getAttribute("diffuse-color");
-		const char* coor = xml.getAttribute("abs-coor");
+		const char* diffuse = (const char*)xml.getAttribute((const wchar_t*)"diffuse-color");
+		const char* coor = (const char*)xml.getAttribute((const wchar_t*)"abs-coor");
 	}
 }
Index: /code/branches/FICN/src/loader/Light.h
===================================================================
--- /code/branches/FICN/src/loader/Light.h	(revision 345)
+++ /code/branches/FICN/src/loader/Light.h	(revision 346)
@@ -7,5 +7,5 @@
 namespace light
 {
-	class Light()
+	class Light
 	{
 	public:      
Index: /code/branches/FICN/src/loader/LightManager.cc
===================================================================
--- /code/branches/FICN/src/loader/LightManager.cc	(revision 345)
+++ /code/branches/FICN/src/loader/LightManager.cc	(revision 346)
@@ -7,5 +7,5 @@
 	LightManager::LightManager()
 	{
-		vector<Light> this->elements_ = new vector<Light>;
+    std::vector<Light> elements_ = *(new std::vector<Light>);
 	}
 	
@@ -14,9 +14,9 @@
 		if (!xml.isEmpty())
 		{
-			int nLights = xml.nChildNode("light");
+			int nLights = xml.nChildNode((const wchar_t*)"light");
 			for (int i=0; i<nLights;i++)
 			{
-				Light l = new Light(xml.getChildNode("light",i));
-				this->elements_.append(l);
+				Light l = *(new Light(xml.getChildNode((const wchar_t*)"light",i)));
+        this->elements_.insert(elements_.end(),l);
 			}
 		}		
Index: /code/branches/FICN/src/loader/LightManager.h
===================================================================
--- /code/branches/FICN/src/loader/LightManager.h	(revision 345)
+++ /code/branches/FICN/src/loader/LightManager.h	(revision 346)
@@ -9,5 +9,5 @@
 namespace light
 {
-	class LightManager()
+	class LightManager
 	{      
 	public:
@@ -20,5 +20,5 @@
 		float ambient_g_;
 		float ambient_b_;
-		vector<Light> elements_;
+    std::vector<Light> elements_;
 	};
 }
Index: /code/branches/FICN/src/network/ClientConnection.cc
===================================================================
--- /code/branches/FICN/src/network/ClientConnection.cc	(revision 345)
+++ /code/branches/FICN/src/network/ClientConnection.cc	(revision 346)
@@ -12,7 +12,12 @@
 #include "ClientConnection.h"
 
+// workaround for usleep(int) under windows
+#ifdef WIN32
+#include "winbase.h"
+#endif
+
 namespace network{
 
-  boost::thread_group network_threads;
+  static boost::thread_group network_threads;
 
   ClientConnection::ClientConnection(int port, std::string address){
@@ -34,5 +39,10 @@
   bool ClientConnection::waitEstablished(int milisec){
     for(int i=0; i<=milisec && !established; i++)
+// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
+#ifdef WIN32
+      Sleep(1);
+#else
       usleep(1000);
+#endif
     return established;
   }
Index: /code/branches/FICN/src/network/GameStateManager.cc
===================================================================
--- /code/branches/FICN/src/network/GameStateManager.cc	(revision 345)
+++ /code/branches/FICN/src/network/GameStateManager.cc	(revision 346)
@@ -106,5 +106,5 @@
   }
   
-  
+  return true;
 }
 
@@ -115,5 +115,5 @@
  */
 // orxonox::Iterator<Synchronisable> removeObject(orxonox::Iterator<Synchronisable> it){
-void removeObject(orxonox::Iterator<Synchronisable> &it){
+void GameStateManager::removeObject(orxonox::Iterator<Synchronisable> &it){
   orxonox::Iterator<Synchronisable> temp=it;
   ++it;
Index: /code/branches/FICN/src/network/GameStateManager.h
===================================================================
--- /code/branches/FICN/src/network/GameStateManager.h	(revision 345)
+++ /code/branches/FICN/src/network/GameStateManager.h	(revision 346)
@@ -44,5 +44,5 @@
   bool loadSnapshot(GameState state);
 private:
-  bool removeObject(orxonox::Iterator<Synchronisable> it);
+  void removeObject(orxonox::Iterator<Synchronisable> &it);
 
 };
Index: /code/branches/FICN/src/network/PacketBufferTest.cc
===================================================================
--- /code/branches/FICN/src/network/PacketBufferTest.cc	(revision 345)
+++ /code/branches/FICN/src/network/PacketBufferTest.cc	(revision 346)
@@ -14,10 +14,10 @@
     p.data=i*i;
     std::cout << i << ": pushing " << p.data << std::endl;
-    test.push(p);
+    test.push((ENetEvent*)&p);
   }
   std::cout << std::endl << "queue.print()" << std::endl;
   test.print();
   while(!test.isEmpty()){
-    int i=test.pop().data;
+    int i = (int)test.pop()->data;
     std::cout << "We popped the value " << i << std::endl;
   }
Index: /code/branches/FICN/src/network/PacketBufferTestExt.cc
===================================================================
--- /code/branches/FICN/src/network/PacketBufferTestExt.cc	(revision 345)
+++ /code/branches/FICN/src/network/PacketBufferTestExt.cc	(revision 346)
@@ -7,4 +7,9 @@
 
 using namespace network;
+
+// workaround for usleep(int) under windows
+#ifdef WIN32
+#include "winbase.h"
+#endif
 
 
@@ -18,7 +23,12 @@
 ENET_PACKET_FLAG_RELIABLE);
     std::cout << i << ": pushing " << packet->data << std::endl;
-    test->push(packet);
+    test->push((ENetEvent*)packet);
     if(i==5)
+// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
+#ifdef WIN32
+      Sleep(200);
+#else
       usleep(200000);
+#endif
   }
   test->setClosed(true);
Index: /code/branches/FICN/src/network/Synchronisable.cc
===================================================================
--- /code/branches/FICN/src/network/Synchronisable.cc	(revision 345)
+++ /code/branches/FICN/src/network/Synchronisable.cc	(revision 346)
@@ -21,5 +21,5 @@
 {
   datasize=0;
-  registerAllVariables();
+  //registerAllVariables();
 }
 
Index: /code/branches/FICN/src/network/Synchronisable.h
===================================================================
--- /code/branches/FICN/src/network/Synchronisable.h	(revision 345)
+++ /code/branches/FICN/src/network/Synchronisable.h	(revision 346)
@@ -52,5 +52,5 @@
   int getSize();
   bool updateData(syncData vars);
-  virtual void registerAllVariables();
+  virtual void registerAllVariables() = 0;
 
 private:
Index: /code/branches/FICN/src/network/dummyclient.cc
===================================================================
--- /code/branches/FICN/src/network/dummyclient.cc	(revision 345)
+++ /code/branches/FICN/src/network/dummyclient.cc	(revision 346)
@@ -8,4 +8,10 @@
 #include <enet/enet.h>
 #include "PacketManager.h"
+
+// workaround for usleep(int) under windows
+#ifdef WIN32
+#include "winbase.h"
+#endif
+
 
 using namespace std;
@@ -67,5 +73,10 @@
       cout << "failed sending" << endl;
     }
+// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
+#ifdef WIN32
+    Sleep(1000);
+#else
     usleep(1000000);
+#endif
   }
 
Index: /code/branches/FICN/src/network/dummyserver.cc
===================================================================
--- /code/branches/FICN/src/network/dummyserver.cc	(revision 345)
+++ /code/branches/FICN/src/network/dummyserver.cc	(revision 346)
@@ -9,4 +9,10 @@
 #include "ConnectionManager.h"
 #include "PacketManager.h"
+
+// workaround for usleep(int) under windows
+#ifdef WIN32
+#include "winbase.h"
+#endif
+
 
 using namespace network;
@@ -23,5 +29,11 @@
   while(!quit){
     if(server.queueEmpty())
+// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
+// Warning: Sleep(1) is ten times longer than usleep(100)!
+#ifdef WIN32
+      Sleep(1);
+#else
       usleep(100);
+#endif
     else{
       ENetAddress addr;
Index: /code/branches/FICN/src/orxonox/core/Identifier.h
===================================================================
--- /code/branches/FICN/src/orxonox/core/Identifier.h	(revision 345)
+++ /code/branches/FICN/src/orxonox/core/Identifier.h	(revision 346)
@@ -8,5 +8,5 @@
 #include "Factory.h"
 
-#define HIERARCHY_VERBOSE false
+#define HIERARCHY_VERBOSE 0
 
 
Index: /code/branches/FICN/src/orxonox/inertial_node.cc
===================================================================
--- /code/branches/FICN/src/orxonox/inertial_node.cc	(revision 346)
+++ /code/branches/FICN/src/orxonox/inertial_node.cc	(revision 346)
@@ -0,0 +1,126 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneNode.h"
+#include "OgreVector3.h"
+
+#include "inertial_node.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+
+  InertialNode::InertialNode(SceneNode *node, Vector3 speed)
+        : node_(node), speed_(speed), childListSize_(4), childListIndex_(0),
+        parentNode_(NULL)
+  {
+    childList_ = new InertialNode*[childListSize_];
+  }
+
+
+  InertialNode::InertialNode(orxonox::InertialNode *parentNode, Vector3 speed)
+        : parentNode_(parentNode), childListSize_(4), childListIndex_(0), speed_(speed)
+  {
+    childList_ = new InertialNode*[childListSize_];
+    node_ = parentNode_->getSceneNode()->createChildSceneNode();
+  }
+
+
+  InertialNode::~InertialNode()
+  {
+    if (childList_)
+    {
+      for (int i = 0; i < childListIndex_; i++)
+        if (childList_[i])
+          delete childList_[i];
+      delete childList_;
+    }
+  }
+
+
+  InertialNode* InertialNode::createChildNode()
+  {
+    InertialNode *temp = new InertialNode(this);
+    addChild(temp);
+    return temp;
+  }
+
+
+  InertialNode* InertialNode::getParentNode()
+  {
+    return parentNode_;
+  }
+
+
+  SceneNode* InertialNode::getSceneNode()
+  {
+    return node_;
+  }
+
+
+  Vector3 InertialNode::getSpeed()
+  {
+    return speed_;
+  }
+
+
+  Vector3 InertialNode::getWorldSpeed()
+  {
+    // go through the tree of Inertial nodes
+    Vector3 speed = speed_;
+    InertialNode *temp = parentNode_;
+    while (temp != NULL)
+    {
+      speed = temp->getSceneNode()->getOrientation() * speed + temp->getSpeed();
+      temp = temp->getParentNode();
+    }
+    return speed;
+  }
+
+
+  void InertialNode::addSpeed(Vector3 speed)
+  {
+    speed_ += speed;
+  }
+
+
+  void InertialNode::addChild(orxonox::InertialNode *node)
+  {
+    if (childListIndex_ == childListSize_)
+    {
+      // redimension the array
+      InertialNode **tempArray = new InertialNode*[2*childListSize_];
+      for (int i = 0; i < childListSize_; i++)
+        tempArray[i] = childList_[i];
+      childListSize_ *= 2;
+      delete childList_;
+      childList_ = tempArray;
+    }
+    childList_[childListIndex_++] = node;
+  }
+
+}
Index: /code/branches/FICN/src/orxonox/objects/test3.cc
===================================================================
--- /code/branches/FICN/src/orxonox/objects/test3.cc	(revision 345)
+++ /code/branches/FICN/src/orxonox/objects/test3.cc	(revision 346)
@@ -33,4 +33,6 @@
         testandcout(test1->usefullClass3isA(Class(Test2)));
         testandcout(test1->usefullClass3isA(Class(Test3)));
+
+        return true;
     }
 
@@ -50,4 +52,6 @@
         testandcout(test2->usefullClass3isA(Class(Test2)));
         testandcout(test2->usefullClass3isA(Class(Test3)));
+
+        return true;
     }
 }
Index: /code/branches/FICN/src/orxonox/ogre_control.h
===================================================================
--- /code/branches/FICN/src/orxonox/ogre_control.h	(revision 346)
+++ /code/branches/FICN/src/orxonox/ogre_control.h	(revision 346)
@@ -0,0 +1,71 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef OGRE_CONTROL_H
+#define OGRE_CONTROL_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OgreControl
+  {
+  public:
+	  OgreControl();
+
+	  virtual ~OgreControl();
+
+	  /** Sets up the application - returns false if the user chooses to abandon configuration. */
+	  virtual bool initialise();
+
+    virtual Ogre::Root* getRoot();
+
+	  virtual Ogre::RenderWindow* getRenderWindow();
+
+	  virtual Ogre::String getResourcePath();
+
+  protected:
+	  /** Configures the application - returns false if the user chooses to abandon configuration. */
+	  virtual bool configure(void);
+
+	  /// Method which will define the source of resources (other than current folder)
+	  virtual void setupResources(void);
+
+  protected:
+	  Ogre::Root         *root_;
+	  Ogre::RenderWindow *window_;
+	  Ogre::String  resourcePath_;
+
+  };
+
+}
+
+#endif /* OGRE_CONTROL_H */
Index: /code/branches/FICN/src/orxonox/orxonox.cc
===================================================================
--- /code/branches/FICN/src/orxonox/orxonox.cc	(revision 345)
+++ /code/branches/FICN/src/orxonox/orxonox.cc	(revision 346)
@@ -33,6 +33,6 @@
 #include <Ogre.h>
 #include <OIS/OIS.h>
-#include <CEGUI/CEGUI.h>
-#include <OgreCEGUIRenderer.h>
+//#include <CEGUI/CEGUI.h>
+//#include <OgreCEGUIRenderer.h>
 
 #include <string>
@@ -209,6 +209,6 @@
       OIS::Mouse *mMouse;
       OIS::InputManager *mInputManager;
-      CEGUI::OgreCEGUIRenderer *mRenderer;
-      CEGUI::System *mSystem;
+      //CEGUI::OgreCEGUIRenderer *mRenderer;
+      //CEGUI::System *mSystem;
       OrxExitListener *mListener;
 
@@ -271,6 +271,6 @@
       {
 
-      string levelFile = "sp_level_moonstation.oxw";
-      loader::LevelLoader* loader = new loader::LevelLoader(levelFile);
+      //string levelFile = "sp_level_moonstation.oxw";
+      //loader::LevelLoader* loader = new loader::LevelLoader(levelFile);
     }
 
Index: /code/branches/FICN/src/orxonox/orxonox_scene.cc
===================================================================
--- /code/branches/FICN/src/orxonox/orxonox_scene.cc	(revision 346)
+++ /code/branches/FICN/src/orxonox/orxonox_scene.cc	(revision 346)
@@ -0,0 +1,155 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreLight.h"
+#include "OgreBillboard.h"
+#include "OgreBillboardSet.h"
+#include "OgreVector3.h"
+
+#include "orxonox_scene.h"
+
+namespace orxonox {
+  using namespace Ogre;
+
+  /**
+  * The orxonox scene includes everything running in the background like terrain,
+  * static figures, dangling lamp, etc.
+  */
+
+
+  /**
+  * 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()
+  {
+	  // Load resources
+	  loadResources();
+
+	  distance_ = 0;
+	  radius_ = 100;
+
+	  createScene();
+
+	  return true;
+  }
+
+
+  /**
+  * 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
+	  ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+  }
+
+
+  /**
+  * Scene creation.
+  * Currently just a test scene with an ogre head an a surrounding light.
+  */
+  void OrxonoxScene::createScene()
+  {
+	  sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3)*2);
+
+	  //create first entity
+	  Entity *head = sceneMgr_->createEntity("head", "ogrehead.mesh");
+
+	  //create a scene node to attach the head to
+	  SceneNode *node = sceneMgr_->getRootSceneNode()
+          ->createChildSceneNode("OgreHeadNode", Vector3(0,0,0));
+	  //attach the ogre head
+	  node->attachObject(head);
+
+	  // set up skybox
+	  sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox1");
+
+	  // 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_ = sceneMgr_->createBillboardSet("bb", 1);
+	  bbs_->createBillboard(Vector3::ZERO, ColourValue(1.0, 1.0, 1.0));
+	  bbs_->setMaterialName("Examples/Flare");
+
+	  lightNode_ = sceneMgr_->getRootSceneNode()
+          ->createChildSceneNode("lightNode_", Vector3(0, 100, 0));
+
+	  lightNode_->attachObject(bbs_);
+	  lightNode_->attachObject(light_);
+  }
+
+
+  /**
+  * 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)
+  {
+	  Real t = time/1000.0;
+
+	  lightNode_->setPosition(radius_*sin(5*t), radius_*cos(5*t), sin(1*t)*distance_);
+  	
+	  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),
+          sin(1*t + 2.09), sin(1*t + 2.09*2)));
+    
+    return true;
+  }
+
+}
Index: /code/branches/FICN/src/orxonox/orxonox_scene.h
===================================================================
--- /code/branches/FICN/src/orxonox/orxonox_scene.h	(revision 346)
+++ /code/branches/FICN/src/orxonox/orxonox_scene.h	(revision 346)
@@ -0,0 +1,70 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_SCENE_H
+#define ORXONOX_SCENE_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OrxonoxScene
+  {
+  public:
+    OrxonoxScene(Ogre::SceneManager*);
+
+	  virtual ~OrxonoxScene();
+
+	  virtual bool initialise();
+
+	  virtual bool tick(unsigned long, Ogre::Real);
+
+  protected:
+	  /// method where you can perform resource group loading
+	  virtual void loadResources();
+
+	  /// Define what is in the scene
+	  virtual void createScene();
+
+  protected:
+	  Ogre::SceneManager* sceneMgr_;
+
+	  //specific variables for test purposes
+	  Ogre::Light        *light_;
+	  Ogre::SceneNode    *lightNode_;
+	  Ogre::BillboardSet *bbs_;
+	  Ogre::Real distance_;
+    Ogre::Real radius_;
+  };
+
+}
+
+#endif /* ORXONOX_SCENE_H */
Index: /code/branches/FICN/src/orxonox/orxonox_ship.cc
===================================================================
--- /code/branches/FICN/src/orxonox/orxonox_ship.cc	(revision 346)
+++ /code/branches/FICN/src/orxonox/orxonox_ship.cc	(revision 346)
@@ -0,0 +1,254 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreQuaternion.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+#include "OgreParticleSystem.h"
+
+#include "inertial_node.h"
+#include "run_manager.h"
+#include "weapon/bullet.h"
+#include "weapon/bullet_manager.h"
+#include "weapon/weapon_station.h"
+#include "weapon/base_weapon.h"
+#include "weapon/barrel_gun.h"
+#include "weapon/ammunition_dump.h"
+
+#include "orxonox_ship.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+  using namespace weapon;
+
+  /**
+  * Base class for any kind of flyable ship in Orxonox.
+  * 
+  * The ship offers steering methods (like left, right, etc.) and translates
+  * them into movement. A ship can also hold more than one weapons (where each
+  * of these can be replaced during the game). This means that a ship can have
+  * many WeaponManagers but only one MunitionManager (independant object that
+  * is referenced in each WeaponManager).
+  * Furthermore a ship in Orxonox is responsible for its visualization, which is
+  * why it receives a pointer to the SceneManager.
+  */
+
+
+  /**
+  * Standard constructor, that only initalizes a few variables. Some of them
+  * could be made static, since any new ship would be derived from the BaseShip.
+  * Or even better: write config files for each ship so that manipulating
+  * its properties would be even easier.
+  * @param mSceneMgr The current main SceneManager
+  * @param mNode The scene node which the ship will be attached to later.
+  */
+  OrxonoxShip::OrxonoxShip(SceneNode *node)
+    : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()),
+      bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()),
+      baseThrust_(1000), currentThrust_(Vector3::ZERO), objectCounter_(0)
+  {
+    rootNode_ = new InertialNode(node, Vector3::ZERO);
+  }
+
+
+  /**
+  * Standard destructor.
+  * Doesn't have any work to do yet.
+  */
+  OrxonoxShip::~OrxonoxShip()
+  {
+    if (mainWeapon_)
+      delete mainWeapon_;
+    if (railGunStation_)
+      delete railGunStation_;
+    if (rootNode_)
+      delete rootNode_;
+  }
+
+
+  /**
+  * Initialises everything.
+  * Once that ResourceGroups are organised, this method loads them.
+  * 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()
+  {
+	  // load all the resources needed (no resource groups yet,
+    // so the allInit is not executed!)
+	  // ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	  // create the "space ship" (currently a fish..)
+	  // TODO: names must be unique! use static variables..
+	  shipEntity_ = sceneMgr_->createEntity("Ship", "fish.mesh");
+	  InertialNode *fishNode = rootNode_->createChildNode();
+    fishNode->getSceneNode()->yaw(Degree(-90));
+	  fishNode->getSceneNode()->attachObject(shipEntity_);
+	  fishNode->getSceneNode()->setScale(Vector3(10, 10, 10));
+
+    // initialise weapon(s)
+    ammoDump_ = new AmmunitionDump();
+    ammoDump_->setDumpSize("Barrel", 1000);
+    ammoDump_->store("Barrel", 420);
+
+    InertialNode *mainWeaponNode = rootNode_->createChildNode();
+    mainWeapon_ = new BarrelGun(mainWeaponNode, ammoDump_);
+
+    railGunStation_ = new WeaponStation(4);
+    railGunStation_->addWeapon(mainWeapon_);
+    railGunStation_->selectWeapon(0);
+
+    // create some nice effects
+
+    ParticleSystem *particles = RunManager::getSingletonPtr()
+      ->getSceneManagerPtr()->createParticleSystem("asdf", "Examples/Smoke");
+
+    fishNode->getSceneNode()->attachObject(particles);
+
+
+
+
+	  return true;
+  }
+
+
+  /**
+  * Gets the ship to accelerate in the current direction.
+  * 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::setMainThrust(const Real value)
+  {
+    currentThrust_.z = value * baseThrust_;
+  }
+
+
+  /**
+  * Gets the ship to accelerate sideways regarding the current direction.
+  * 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::setSideThrust(const Real value)
+  {
+    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)
+  {
+    currentThrust_.y = value * baseThrust_;
+  }
+
+
+  /**
+  * Rotate the ship along with the camera up and down.
+  * @param angle Pitch value.
+  */
+  void OrxonoxShip::turnUpAndDown(const Radian &angle)
+  {
+    rootNode_->getSceneNode()->pitch(-angle, Node::TS_LOCAL);
+  }
+
+
+  /**
+  * Rotate the ship along with the camera left and right.
+  * @param angle Yaw value.
+  */
+  void OrxonoxShip::turnLeftAndRight(const Radian &angle)
+  {
+    rootNode_->getSceneNode()->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 rootNode_->getSpeed();
+  }
+
+  /**
+  * Returns the ship's root SceneNode.
+  * @return The Root Node.
+  */
+  InertialNode* OrxonoxShip::getRootNode()
+  {
+    return rootNode_;
+  }
+
+
+  /**
+  * Fire a bullet (Entity with SceneNode).
+  * 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.
+  */
+  BaseWeapon* OrxonoxShip::getMainWeapon()
+  {
+    return mainWeapon_;
+  }
+
+
+  int OrxonoxShip::getAmmoStock()
+  {
+    return ammoDump_->getStockSize("Barrel");
+  }
+
+
+  /**
+  * Standard tick() function.
+  * Currently, only the speed is applied according to the thrust values.
+  * @param time Absolute time.
+  * @param deltaTime Relative time.
+  * @return Return true to continue render
+  */
+  bool OrxonoxShip::tick(unsigned long time, Real deltaTime)
+  {
+    mainWeapon_->tick(time, deltaTime);
+
+    Quaternion quad = rootNode_->getSceneNode()->getOrientation();
+    quad.normalise();
+    rootNode_->addSpeed(quad * (Vector3(-1, -1, -1) * currentThrust_) * deltaTime);
+
+    rootNode_->getSceneNode()->translate(rootNode_->getSpeed() * deltaTime);
+
+	  return true;
+  }
+
+}
Index: /code/branches/FICN/src/orxonox/orxonox_ship.h
===================================================================
--- /code/branches/FICN/src/orxonox/orxonox_ship.h	(revision 346)
+++ /code/branches/FICN/src/orxonox/orxonox_ship.h	(revision 346)
@@ -0,0 +1,86 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_SHIP_H
+#define ORXONOX_SHIP_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OrxonoxShip
+  {
+  public:
+    OrxonoxShip(Ogre::SceneNode*);
+	  virtual ~OrxonoxShip();
+
+	  virtual bool initialise();
+
+	  void setMainThrust(const Ogre::Real);
+	  void setSideThrust(const Ogre::Real);
+    void setYThrust(const Ogre::Real);
+	  void turnUpAndDown(const Ogre::Radian&);
+	  void turnLeftAndRight(const Ogre::Radian&);
+
+    InertialNode* getRootNode();
+    Ogre::Vector3 getSpeed();
+
+    weapon::BaseWeapon* getMainWeapon();
+
+    int getAmmoStock();
+
+	  bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  protected:
+	  Ogre::SceneManager *sceneMgr_;
+	  //Ogre::SceneNode *rootNode_;
+    InertialNode *rootNode_;
+	  Ogre::Entity *shipEntity_;
+
+	  //Ogre::Vector3 currentSpeed_;  // relative to space
+	  Ogre::Vector3 currentThrust_; // relative to the ship
+    Ogre::Real baseThrust_;
+	  int objectCounter_;
+
+    weapon::BulletManager *bulletManager_;
+	  //Ogre::Vector3 bulletSpeed_;
+
+    weapon::BaseWeapon *mainWeapon_;
+    weapon::WeaponStation *railGunStation_;
+
+    weapon::AmmunitionDump *ammoDump_;
+  };
+
+}
+
+#endif /* ORXONOX_SHIP_H */
Index: /code/branches/FICN/src/orxonox/run_manager.cc
===================================================================
--- /code/branches/FICN/src/orxonox/run_manager.cc	(revision 346)
+++ /code/branches/FICN/src/orxonox/run_manager.cc	(revision 346)
@@ -0,0 +1,512 @@
+/*
+*   ORXONOX - the hottest 3D action shooter ever to exist
+*
+*
+*   License notice:
+*
+*   This program is free software: you can redistribute it and/or modify
+*   it under the terms of the GNU General Public License as published by
+*   the Free Software Foundation, either version 3 of the License, or
+*   (at your option) any later version.
+*
+*   This program is distributed in the hope that it will be useful,
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*   GNU General Public License for more details.
+*
+*   You should have received a copy of the GNU General Public License
+*   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*   Author:
+*      Reto Grieder
+*   Co-authors:
+*      ...
+*/
+
+
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreCamera.h"
+#include "OgreViewport.h"
+#include "OgreRenderWindow.h"
+#include "OgreTextureManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreLogManager.h"
+#include "OgreWindowEventUtilities.h"
+
+//Use this define to signify OIS will be used as a DLL
+//(so that dll import/export macros are in effect)
+#define OIS_DYNAMIC_LIB
+#include <OIS/OIS.h>
+
+#include "ogre_control.h"
+#include "orxonox_scene.h"
+#include "orxonox_ship.h"
+#include "inertial_node.h"
+
+#include "weapon/bullet.h"
+#include "weapon/bullet_manager.h"
+#include "weapon/base_weapon.h"
+
+#include "hud/hud_overlay.h"
+#include "hud/test_overlay.h"
+
+#include "run_manager.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+  using namespace weapon;
+  using namespace hud;
+
+  /**
+  * RunManager is the basic control object during the game.
+  * 
+  * The RunManger class is designed to actually "run" the main part of the
+  * game. The Idea is, that you could derive from the RunManager in order
+  * to distinguish between a first person shooter or a space craft shooter.
+  * RunManager loads and initialises everything in the scene (like the ship,
+  * the enemies in the scene, any scripts, the physics, window events,
+  * environment, HUD, etc.).
+  * It also captures any input from keyboard, mous, joystick (optional) or
+  * Ogre (window events).
+  */
+
+
+  RunManager* RunManager::singletonPtr_s = NULL;
+
+
+  /**
+  * Contructor only needs the Root object.
+  */
+  RunManager::RunManager()
+        : ogre_(NULL), window_(NULL), screenShotCounter_(0),
+        timeUntilNextToggle_(0), mouseSensitivity_(0.003), inputManager_(0),
+        mouse_(0), keyboard_(0), joystick_(0), statsOn_(true)
+  {
+  }
+
+  /**
+  * @param ogre_ The OgreControl object holding the render window and the Root
+  */
+  void RunManager::initialise(OgreControl *ogre)
+    {
+    ogre_ = ogre;
+    window_ = ogre->getRenderWindow();
+
+    // SETTING UP THE SCENE
+
+    // create one new SceneManger
+    sceneMgr_ = ogre_->getRoot()->createSceneManager(ST_GENERIC, "Orxonox Scene");
+
+    // background scene (world objects, skybox, lights, etc.)
+    backgroundScene_ = new OrxonoxScene(sceneMgr_);
+
+
+    // BULLET LIST FOR THE TEST APPLICATION
+
+    // create a bullet manager
+    bulletManager_ = new BulletManager(sceneMgr_);
+
+
+    // PLAYER SPACESHIP
+
+    // Create a space ship object and its SceneNode.
+    // It should also be considered, that the ship should provide another Node
+    // for a camera to be attached (otherwise the spaceship in front of the
+    // ship would be very static, never moving at all).
+
+    // Construct a new spaceship and give it the node
+    playerShip_ = new OrxonoxShip(sceneMgr_->getRootSceneNode()
+      ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)));
+
+
+    // RESOURCE LOADING (using ResourceGroups if implemented)
+
+    // load all resources and create the entities by calling the initialise()
+    // methods for each object (no constructor initialisations!).
+    backgroundScene_->initialise();
+    playerShip_->initialise();
+
+
+    // CAMERA AND VIEWPORT
+
+    // create camera and viewport
+    createCamera();
+    createViewports();
+
+    // create HUD
+    hud_ = new hud::TestOverlay(window_);
+    hud_->show();
+
+
+    // Set default mipmap level (NB some APIs ignore this)
+    TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+
+    // HUMAN INTERFACE
+
+    using namespace OIS;    
+
+    LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
+    ParamList pl;
+    size_t windowHnd = 0;
+    std::ostringstream windowHndStr;
+
+    window_->getCustomAttribute("WINDOW", &windowHnd);
+    windowHndStr << windowHnd;
+    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+    inputManager_ = InputManager::createInputSystem( pl );
+
+    // Create all devices (We only catch joystick exceptions here,
+    // as, most people have Key/Mouse)
+    keyboard_ = static_cast<Keyboard*>(inputManager_
+      ->createInputObject( OISKeyboard, false ));
+    mouse_ = static_cast<Mouse*>(inputManager_
+      ->createInputObject( OISMouse, false ));
+    try {
+      joystick_ = static_cast<JoyStick*>(inputManager_
+        ->createInputObject( OISJoyStick, false ));
+    }
+    catch(...) {
+      joystick_ = 0;
+    }
+
+    //Set initial mouse clipping size
+    windowResized(window_);
+
+    //showDebugOverlay(true);
+
+    // REGISTER THIS OBJECT AS A WINDOW EVENT LISTENER IN OGRE
+    // It will then receive events liek windowClosed, windowResized, etc.
+    WindowEventUtilities::addWindowEventListener(window_, this);
+  }
+
+  /**
+  * Standard destructor.
+  * Removes this object as a window event listener and deletes all created
+  * variables.
+  */
+  RunManager::~RunManager()
+  {
+    //Remove ourself as a Window listener
+    WindowEventUtilities::removeWindowEventListener(window_, this);
+    windowClosed(window_);
+
+    if (backgroundScene_)
+      delete backgroundScene_;
+    if (playerShip_)
+      delete playerShip_;
+    if (bulletManager_)
+      delete bulletManager_;
+    if (hud_)
+      delete hud_;
+  }
+
+
+  /**
+  * Method to compute anything between 2 frames.
+  * 
+  * Everything that needs to be computed during the games happens right here.
+  * The only exception are the listeners (which should only set variables,
+  * not actually do something).
+  * 
+  * @param time Absolute play time
+  * @param deltaTime Time passed since last frame
+  * @return Return false to end rendering
+  */
+  bool RunManager::tick(unsigned long time, float deltaTime)
+  {
+    // synchronize with internal class timer
+    totalTime_ = time;
+
+    // Call tick() for every object
+    // This could be done by registering (needs a factory..)
+    backgroundScene_->tick(time, deltaTime);
+    playerShip_->tick(time, deltaTime);
+
+
+    // Update the HUD
+    Ogre::String tempStr = " | Speed = "
+      + StringConverter::toString(playerShip_->getSpeed())
+      + " | Left Ammo = "
+      + StringConverter::toString(playerShip_
+      ->getMainWeapon()->getAmmoState())
+      + " | Ammo stock = "
+      + StringConverter::toString(playerShip_->getAmmoStock());
+    hud_->setDebugText(tempStr);
+
+    hud_->tick(time, deltaTime);
+
+    // update the bullet positions
+    bulletManager_->tick(time, deltaTime);
+
+
+    // HUMAN INTERFACE
+
+    using namespace OIS;
+
+    if(window_->isClosed())	return false;
+
+    //Need to capture/update each device
+    keyboard_->capture();
+    mouse_->capture();
+    if( joystick_ ) joystick_->capture();
+
+    bool buffJ = (joystick_) ? joystick_->buffered() : true;
+
+    //Check if one of the devices is not buffered
+    if( !mouse_->buffered() || !keyboard_->buffered() || !buffJ )
+    {
+      // one of the input modes is immediate, so setup what
+      // is needed for immediate movement
+      if (timeUntilNextToggle_ >= 0)
+        timeUntilNextToggle_ -= deltaTime;
+    }
+
+    // handle HID devices
+    if( processUnbufferedKeyInput() == false )
+        return false;
+    if( processUnbufferedMouseInput() == false )
+        return false;
+
+    // keep rendering
+    return true;
+  }
+
+
+  SceneManager& RunManager::getSceneManager()
+  {
+    return *sceneMgr_;
+  }
+
+  SceneManager* RunManager::getSceneManagerPtr()
+  {
+    return sceneMgr_;
+  }
+
+  BulletManager* RunManager::getBulletManagerPtr()
+  {
+    return bulletManager_;
+  }
+
+  int RunManager::getAmmunitionID(const Ogre::String &ammoName)
+  {
+    Ogre::String ammoTypes[] = { "Energy Cell", "Barrel", "Lead Shot" };
+    int ammoTypesLength = 3;
+
+    for (int i = 0; i < ammoTypesLength; i++)
+    {
+      if (ammoTypes[i] == ammoName)
+        return i;
+    }
+    return -1;
+  }
+
+  int RunManager::getNumberOfAmmos()
+  {
+    return 3;
+  }
+
+
+  /**
+  * Adjust mouse clipping area.
+  * This method is called by Ogre without regards of tick()!
+  * Avoid doing too much in this call.
+  * @param rw render window
+  */
+  void RunManager::windowResized(RenderWindow* rw)
+  {
+    unsigned int width, height, depth;
+    int left, top;
+    rw->getMetrics(width, height, depth, left, top);
+
+    const OIS::MouseState &ms = mouse_->getMouseState();
+    ms.width = width;
+    ms.height = height;
+  }
+
+
+  /**
+  * Unattach OIS before window shutdown (very important under Linux).
+  * Again, avoid computing a lot in this function.
+  * @param rw Render Window
+  */
+  void RunManager::windowClosed(RenderWindow* rw)
+  {
+    //Only close for window that created OIS (the main window in these demos)
+    if( rw == window_ )
+    {
+      if( inputManager_ )
+      {
+        inputManager_->destroyInputObject( mouse_ );
+        inputManager_->destroyInputObject( keyboard_ );
+        inputManager_->destroyInputObject( joystick_ );
+
+        OIS::InputManager::destroyInputSystem(inputManager_);
+        inputManager_ = 0;
+      }
+    }
+  }
+
+  /**
+  * Processes the Keyboard input.
+  * TODO: Use listeners to improve performance.
+  * A lookup table should be implemented to bind any key to a specific action.
+  * @return Return true to keep rendering
+  */
+  bool RunManager::processUnbufferedKeyInput()
+  {
+    using namespace OIS;
+
+    if(keyboard_->isKeyDown(KC_A) || keyboard_->isKeyDown(KC_LEFT))
+      playerShip_->setSideThrust(1);
+    else if(keyboard_->isKeyDown(KC_D) || keyboard_->isKeyDown(KC_RIGHT))
+      playerShip_->setSideThrust(-1);
+    else
+      playerShip_->setSideThrust(0);
+
+    if(keyboard_->isKeyDown(KC_UP) || keyboard_->isKeyDown(KC_W) )
+      playerShip_->setMainThrust(1);
+    else if(keyboard_->isKeyDown(KC_DOWN) || keyboard_->isKeyDown(KC_S) )
+      playerShip_->setMainThrust(-1);
+    else
+      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_G))
+      playerShip_->getMainWeapon()->addAction(BaseWeapon::RELOAD);
+
+    if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) )
+      return false;
+
+    if( keyboard_->isKeyDown(KC_F) && timeUntilNextToggle_ <= 0 )
+    {
+      statsOn_ = !statsOn_;
+      timeUntilNextToggle_ = 1;
+    }
+
+    if(keyboard_->isKeyDown(KC_SYSRQ) && timeUntilNextToggle_ <= 0)
+    {
+      std::ostringstream ss;
+      ss << "screenshot_" << ++screenShotCounter_ << ".png";
+      window_->writeContentsToFile(ss.str());
+      timeUntilNextToggle_ = 0.5;
+    }
+
+    // Return true to continue rendering
+    return true;
+  }
+
+
+  /**
+  * Processes the Mouse input.
+  * TODO: Use listeners to improve performance.
+  * A lookup table should be implemented to bind ANY button or movement
+  * to a specific action.
+  * @return Return true to keep rendering
+  */
+  bool RunManager::processUnbufferedMouseInput()
+  {
+    using namespace OIS;
+
+    const MouseState &ms = mouse_->getMouseState();
+
+    if (ms.buttonDown(MB_Left))
+      playerShip_->getMainWeapon()->primaryFireRequest();
+
+    if (ms.buttonDown(MB_Right))
+      playerShip_->getMainWeapon()->secondaryFireRequest();
+
+    playerShip_->turnUpAndDown(Radian(ms.Y.rel * mouseSensitivity_));
+    playerShip_->turnLeftAndRight(Radian(ms.X.rel * mouseSensitivity_));
+
+    // keep rendering
+    return true;
+  }
+
+  /**
+  * Show an overlay desired.
+  * @param show Whether or not to show the debug overlay
+  */
+  void RunManager::showDebugOverlay(bool show)
+  {
+    if (hud_)
+    {
+      if (show)
+        hud_->show();
+      else
+        hud_->hide();
+    }
+  }
+
+
+  /**
+  * Simple camera creator.
+  * playerShip_Node->attachObject(camera_) should not be here! This is what
+  * the camera manager is for. Right now, this method should do just fine,
+  * setting the cam behind the ship.
+  */
+  void RunManager::createCamera()
+  {
+    camera_ = sceneMgr_->createCamera("PlayerCam");
+    playerShip_->getRootNode()->getSceneNode()->attachObject(camera_);
+    camera_->setNearClipDistance(5);
+    camera_->setPosition(Vector3(0,10,500));
+    camera_->lookAt(Vector3(0,0,0));
+  }
+
+  /**
+  * Simple viewport creator.
+  * For now the viewport uses the entire render window and is based on the one
+  * camera created so far.
+  */
+  void RunManager::createViewports()
+  {
+    // Create one viewport, entire window
+    Viewport* vp = window_->addViewport(camera_);
+    vp->setBackgroundColour(ColourValue(0,0,0));
+
+    // Alter the camera aspect ratio to match the viewport
+    camera_->setAspectRatio(
+      Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+  }
+
+
+  RunManager* RunManager::createSingleton()
+  {
+    if (singletonPtr_s)
+      return NULL;
+    singletonPtr_s = new RunManager();
+    return singletonPtr_s;
+  }
+
+  void RunManager::destroySingleton()
+  {
+    if (singletonPtr_s)
+      delete singletonPtr_s;
+  }
+
+
+  RunManager& RunManager::getSingleton()
+  {
+    return *singletonPtr_s;
+  }
+
+  RunManager* RunManager::getSingletonPtr()
+  {
+    return singletonPtr_s;
+  }
+
+}
