Index: GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h	(revision 2388)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h	(revision 2391)
@@ -26,4 +26,5 @@
 #include "NXOgre.h"
 #include "SceneSerializer.h"
+#include "FPSPlayer.h"
 
 AnimationState* mAnimState;
@@ -31,4 +32,5 @@
 Body *throwSphere = 0;
 Scene* NXScene = 0;
+FPSPlayer* gFPSPlayer;
 
 // Listener class for frame updates
@@ -52,4 +54,5 @@
 		mMoveSpeed /= 50.0;
 		this->sysNode = sysNode;
+
     }
 
@@ -67,6 +70,7 @@
 	  
 	    mAnimState->addTime(evt.timeSinceLastFrame * 0.5);  
-
-		sysNode->setPosition(mCamera->getPosition() - Vector3(0,1.5,0));
+		
+
+	//	sysNode->setPosition(mCamera->getPosition() - Vector3(0,1.5,0));
 
         return ExampleFrameListener::frameStarted(evt);     
@@ -75,4 +79,12 @@
 	bool processUnbufferedKeyInput(const FrameEvent& evt)
     {
+		gFPSPlayer->processKeyInputs(mInputDevice);
+
+		static float lastTime = 0;
+		static Timer* t = Root::getSingleton().getTimer();
+		float thisTime = (float) t->getMilliseconds() / 1000.0f;
+		float dt = thisTime-lastTime;
+		lastTime = thisTime;
+		
 		
 		if (mInputDevice->isKeyDown(KC_SPACE)) {
@@ -92,9 +104,27 @@
 	
 		}
-		return ExampleFrameListener::processUnbufferedKeyInput(evt);
-	}
-
-	
-
+
+		
+		//return ExampleFrameListener::processUnbufferedKeyInput(evt);
+
+		if( mInputDevice->isKeyDown( KC_ESCAPE) )
+        {            
+            return false;
+        }
+		if (mInputDevice->isKeyDown(KC_F) && mTimeUntilNextToggle <= 0)
+        {
+            mStatsOn = !mStatsOn;
+            showDebugOverlay(mStatsOn);
+
+            mTimeUntilNextToggle = 1;
+        }
+		return true;
+	}
+
+	bool processUnbufferedMouseInput(const FrameEvent& evt)
+	{
+		gFPSPlayer->processMouseInputs(mInputDevice);
+		return true;
+	}
 };
 
@@ -128,5 +158,5 @@
 	void createPostproc()
 	{		
-	/*	CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),
+		CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),
 														"GTP/PostProc/Glow");
 		CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0),
@@ -136,10 +166,10 @@
 														"GTP/PostProc/ToneMap");
 		CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0),
-														"GTP/PostProc/ToneMap", true);	*/
-
-		CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),
+														"GTP/PostProc/ToneMap", true);	
+
+	/*	CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),
 														"GTP/PostProc/Plain");
 		CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0),
-														"GTP/PostProc/Plain", true);	
+														"GTP/PostProc/Plain", true);	*/
 		
 	}
@@ -156,5 +186,5 @@
 		//mSceneMgr->setWorldGeometry(occlusion_cfg);
 		
-		//createPostproc();
+		createPostproc();
 
 		OgreIlluminationManager::getSingleton().setMainCamera(mCamera);
@@ -185,9 +215,12 @@
 		inputStream = ResourceGroupManager::getSingleton().openResource("moria.level");	//towers2.level	
 		World* NXWorld = new World("FrameListener: yes, log: html");
-		NXScene = NXWorld->createScene("Main", mSceneMgr, "gravity: yes, floor: yes"); 
+		NXScene = NXWorld->createScene("Main", mSceneMgr, "gravity: yes, floor: no"); 
 		s.setScene(NXScene);
 		s.setWorld(NXWorld);
 		s.parseScript(inputStream, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
 		s.parseEntryPoints("prmEntryPoints.text");
+
+		NXScene->createActor("FakeFloor", new CubeShape(100,2,100), Vector3(0,-1,0), "static: yes"); 
+		
 /*
 		Body* b = NXScene->createBody("ize",
@@ -225,9 +258,9 @@
 		
 		mainLightNode->setPosition(15,5,15);		
-		mainLight->setPowerScale(30);
+		mainLight->setPowerScale(20);
 		//mainLight->setDirection(1,0, 0);
 		mainLightNode->attachObject(mainLight);
 		//mainLight->setSpotlightRange(Degree(0),Degree(120));
-		mainLight->setAttenuation(20.0, 0, 8, 0);
+		mainLight->setAttenuation(1000.0, 0, 8, 0);
 /*
 		Light* blueLight = mSceneMgr->createLight("blueLight");
@@ -258,4 +291,21 @@
             mAnimState->setEnabled(true);
 
+		gFPSPlayer = new FPSPlayer(NXScene, mSceneMgr, Vector3(0.1, 0.6, 0.1), Vector3(5, 10, 5), 0.5, mCamera);
+		gFPSPlayer->addPlayerMesh("FPSarm.mesh", 0.005, true);
+		gFPSPlayer->addWeaponModel("sword.mesh", "joint28");
+
+		for(float i = 0; i< 10; i++)
+		{
+			ActorParams ac;
+			ac.setToDefault();
+			ac.mass = 10.0;
+			ac.nodescale = 1.0;
+			NXScene->createBody("cube.mesh",
+								new CubeShape(1, 1, 1),
+								Vector3(3,i,3),
+								ac);
+		}
+		
+/*
 	   ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "MoriaDust");
 	   pSys1->setKeepParticlesInLocalSpace(true);
@@ -263,4 +313,5 @@
 	   pSysNode->attachObject(pSys1);
 	   pSysNode->setPosition(0,0,0);
+*/
 
 		OgreIlluminationManager::getSingleton().initTechniques();
@@ -292,8 +343,11 @@
 		mFrameListener= new MoriaDemoFrameListener(mWindow,
 			mCamera, mainLightNode, mainLight, pSysNode	);
-       mFrameListener->setPriority(2);	
+        mFrameListener->setPriority(2);	
 		mRoot->addFrameListener(mFrameListener);
-		OgreIlluminationManager::getSingleton().setPriority(3);
-	   mRoot->addFrameListener(&OgreIlluminationManager::getSingleton());
+		gFPSPlayer->setPriority(3);
+	    mRoot->addFrameListener(gFPSPlayer);
+		OgreIlluminationManager::getSingleton().setPriority(4);
+	    mRoot->addFrameListener(&OgreIlluminationManager::getSingleton());
+	  
     }
 
Index: GTP/trunk/App/Demos/Illum/Ogre/src/Moria/scripts/Moria.7.10.vcproj
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/Moria/scripts/Moria.7.10.vcproj	(revision 2388)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/Moria/scripts/Moria.7.10.vcproj	(revision 2391)
@@ -141,4 +141,7 @@
 			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
 			<File
+				RelativePath="..\..\Common\src\FPSPlayer.cpp">
+			</File>
+			<File
 				RelativePath="..\src\Moria.cpp">
 			</File>
@@ -147,4 +150,7 @@
 			Name="Header Files"
 			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\..\Common\include\FPSPlayer.h">
+			</File>
 			<File
 				RelativePath="..\include\Moria.h">
