Index: GTP/trunk/App/Demos/Illum/Ogre/src/PRMDemo/include/PRMDemo.h
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/PRMDemo/include/PRMDemo.h	(revision 2405)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/PRMDemo/include/PRMDemo.h	(revision 2411)
@@ -60,6 +60,10 @@
 	   t += dt;
 
-	   //blueLight->setDirection(sin(t),sin(t),cos(t));
-	   blueLight->getParentSceneNode()->setPosition(30 * sin(t), 1, 30 * cos(t));
+	   Vector3 pos(30 * sin(t), 1, 30 * cos(t));
+	   blueLight->getParentSceneNode()->setPosition(pos);
+	   Vector3 dir = pos;
+	   dir.normalise();
+	   blueLight->setDirection(dir);
+	  
 	  
         return result;     
@@ -278,5 +282,5 @@
 */
 		blueLight = mSceneMgr->createLight("BlueLight");
-		blueLight->setType(Light::LT_POINT);
+		blueLight->setType(Light::LT_SPOTLIGHT);
 		blueLight->setCastShadows(true);
         blueLight->setDiffuseColour(ColourValue(1,1,1,1));
@@ -288,6 +292,7 @@
 		blueLight->setPowerScale(200);
 	//	blueLight->setDirection(1, 0, 0);
-	//	blueLight->setSpotlightOuterAngle(Radian(Degree(90)));
-		blueLight->setAttenuation(200, 0, 0, 1);
+		blueLight->setSpotlightOuterAngle(Radian(Degree(90)));
+		blueLight->setSpotlightFalloff(1);
+		blueLight->setAttenuation(2000, 0, 0, 1);
 		blueLightNode->attachObject(blueLight); 	
 
Index: GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h	(revision 2405)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h	(revision 2411)
@@ -80,5 +80,5 @@
     {
 		gFPSPlayer->processKeyInputs(mInputDevice);
-
+/*
 		static float lastTime = 0;
 		static Timer* t = Root::getSingleton().getTimer();
@@ -103,8 +103,8 @@
 			throwSphere->addForce(mCamera->getDirection()*200);
 	
-		}
-
-		
-		//return ExampleFrameListener::processUnbufferedKeyInput(evt);
+		}*/
+
+		
+	//	return ExampleFrameListener::processUnbufferedKeyInput(evt);
 
 		if( mInputDevice->isKeyDown( KC_ESCAPE) )
@@ -133,4 +133,5 @@
 	{
 		gFPSPlayer->processMouseInputs(mInputDevice);
+//		return ExampleFrameListener::processUnbufferedMouseInput(evt);
 		return true;
 	}
@@ -214,9 +215,9 @@
 				
 		Root::getSingleton()._setCurrentSceneManager(mSceneMgr);
-		mCamera->setPosition(-20,3,0);
+		//mCamera->setPosition(-20,3,0);
 		//mCamera->setPosition(0,100,0);
 		//mCamera->lookAt(0,-1,0);
-		mCamera->setFOVy(Radian(Degree(80)));
-		mCamera->setNearClipDistance(0.01);
+		mCamera->setFOVy(Radian(Degree(90)));
+		mCamera->setNearClipDistance(0.001);
 		mCamera->setFarClipDistance(150);
 		// Set ambient light
@@ -307,11 +308,12 @@
             mAnimState->setEnabled(true);*/
 
-//		PlayerCharacter::frameListenerPriority = 20;
+		PlayerCharacter::frameListenerPriority = 20;
 		gFPSPlayer = new FPSPlayer(NXScene, mSceneMgr, Vector3(0.5, 1.8, 0.3), Vector3(5, 10, 15), 1.6, mCamera, false);
 		//gFPSPlayer->addPlayerMesh("FPSarm.mesh", 0.02, true);
 		//gFPSPlayer->addWeaponModel("sword.mesh", "joint28");
-/*
+
 		PlayerCharacter* troll = new PlayerCharacter("troll1", NXScene, mSceneMgr, Vector3(1.5, 3.0, 1.2), Vector3(5, 10, 5), false);
-		troll->addPlayerMesh("troll.mesh", 0.05, false);*/
+		troll->addPlayerMesh("troll.mesh", 0.05, false);
+
 		for(float i = 0; i< 7; i++)
 		{
Index: GTP/trunk/App/Demos/Illum/Ogre/src/Common/include/FPSPlayer.h
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/Common/include/FPSPlayer.h	(revision 2405)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/Common/include/FPSPlayer.h	(revision 2411)
@@ -30,5 +30,5 @@
 	bool frameStarted(const FrameEvent& evt);
 	virtual void addWeaponModel(String meshname, String attachBoneName);
-	void doAction();
+	void doAction(float dt);
 
 	static unsigned int frameListenerPriority;
@@ -85,5 +85,6 @@
 	virtual void processMouseInputs(InputReader* inputDevice);	
 	void addWeaponModel(String meshname, String attachBoneName);
-	Vector3 getPosition(){return mPlayerCharacter->getGlobalPosition();}
+	Vector3 getPosition(){return mPlayerNode->getWorldPosition();
+		return mPlayerCharacter->getGlobalPosition();}
 //	Vector3 getOrienation(){return mPlayerCharacter->getGlobalOrientation();}
 
Index: GTP/trunk/App/Demos/Illum/Ogre/src/Common/src/FPSPlayer.cpp
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/Common/src/FPSPlayer.cpp	(revision 2405)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/Common/src/FPSPlayer.cpp	(revision 2411)
@@ -21,28 +21,10 @@
 {
 public:
-	MyCharMoveController(float speed = 1.5){movespeed = speed; mWeaponBound = 0;}
+	MyCharMoveController(float speed = 1.5){movespeed = speed;}
 	float movespeed;
-	Actor* mWeaponBound;
-	Vector3 mWeaponPosition;
-	SceneNode* mWeaponDebugNode;
 	void move(NxVec3 &out, NxVec3 &moveVector, NxQuat &direction, NxVec3 &g, float t, Character*)
 	{
 		NxVec3 dir = direction.rot(moveVector);
-		out = ((dir * movespeed) + g) * t;
-	
-		if(mWeaponBound)
-		{
-			Vector3 addDir(0,0,0);
-			//if(moveVector.z < 0)
-				addDir = Vector3(dir.x,0,dir.z) * t * movespeed * 1.2;
-			
-			Vector3 newPos = mWeaponPosition/* + addDir*/;
-			mWeaponBound->setGlobalPosition(newPos);
-			mWeaponBound->simulate(t);
-			//if(mWeaponDebugNode)
-			//mWeaponDebugNode->setPosition(newPos);
-			//mWeaponBound->moveGlobalPosition(mWeaponPosition);
-			//mWeaponDebugNode->setPosition(mWeaponPosition);
-		}
+		out = ((dir * movespeed) + g) * t;		
 	}
 };
@@ -63,4 +45,5 @@
 	mPlayerNode = mPlayerCharacter->getNode();
 	
+	mCharacterController = 0;
 	mCharacterController = new MyCharMoveController(2.0);
 	mPlayerCharacter->setMovementVectorController(mCharacterController);
@@ -73,12 +56,21 @@
 	}
 
-	//mCharacterMesh_AnimState = 0;
+	mCharacterMesh_AnimState = 0;
 	mForceAnimChange = false;
 	mWeapon = 0;
 	mWeaponBound = 0;
 	mWeaponBoundDebugNode = 0;
-	
-//	this->setPriority(frameListenerPriority++);
-//	Root::getSingleton().addFrameListener(this);
+	mCharacterMeshEntity = 0;
+	mWeaponEntity = 0;
+	mWeaponAttachBone = 0;
+    mWeaponNode = 0;
+	mWeaponBoundNode = 0;
+	mWeaponBoundDebugNode = 0;
+	mPlayerBoundDebugNode = 0;
+	mWeaponBound = 0;
+	mWeaponNode2 = 0;
+		
+	this->setPriority(frameListenerPriority++);
+	Root::getSingleton().addFrameListener(this);
 
 	//mPlayerCharacter->setCharacterCollisionGroup(NX_CHARACTER_COL_GROUP_CHARACTER);
@@ -91,7 +83,6 @@
 	mCameraHeight = cameraHeight - dimensions.y / 2.0;
 	mCamera = cam;
-	mCamera->setPosition(Vector3(0, mCameraHeight, 0));
 	mPlayerNode->attachObject(cam); 
-
+	
 	thePlayer = this;
 }
@@ -116,4 +107,5 @@
 	if(rotateModel)
 	meshNode->rotate(Vector3::UNIT_Y, Degree(180.0));
+	meshNode->_updateBounds();
 }
 
@@ -171,7 +163,5 @@
 	mWeaponBound = new MyTrigger(mName + "_WeaponTrigger", mScene, new CubeShape(dimX, dimY, dimZ, "trigger: yes"), Vector3(0,0,0), "mass: 0, density: 0");
 	mScene->addTrigger((Trigger*)mWeaponBound);
-	
-	mCharacterController->mWeaponBound = mWeaponBound;
-	
+		
 	if(mDebug)
 	{
@@ -179,5 +169,4 @@
 		mWeaponBoundDebugNode->setScale(dim);
 		mWeaponBoundDebugNode->attachObject(mSceneManager->createEntity(mName+"_WeaponBoundDebug", "cube.mesh"));
-		mCharacterController->mWeaponDebugNode = mWeaponBoundDebugNode;
 	}
 
@@ -224,6 +213,4 @@
 	mScene->addTrigger((Trigger*)mWeaponBound);
 	
-	mCharacterController->mWeaponBound = mWeaponBound;
-	
 	if(mDebug)
 	{
@@ -231,5 +218,4 @@
 		mWeaponBoundDebugNode->setScale(dim);
 		mWeaponBoundDebugNode->attachObject(mSceneManager->createEntity(mName+"_WeaponBoundDebug", "cube.mesh"));
-		mCharacterController->mWeaponDebugNode = mWeaponBoundDebugNode;
 	}
 
@@ -237,5 +223,5 @@
 }
 
-void PlayerCharacter::doAction()
+void PlayerCharacter::doAction(float dt)
 {
 	FPSPlayer* thePlayer = FPSPlayer::getPlayer();
@@ -244,23 +230,18 @@
 	{
 		Vector3 playerPos = thePlayer->getPosition();
-		Vector3 myPos = mPlayerCharacter->getGlobalPosition();
+		Vector3 myPos = mPlayerNode->getWorldPosition();
 		Vector3 dir = playerPos - myPos;
 		dir.y = 0;
-		if( dir.length() > 1.0)
-		{
+		//if( dir.length() > 1.0)
+		//{
 			dir.normalise();
-			Vector3 right = dir.crossProduct(Vector3::UNIT_Y);
-			Quaternion q; 
-			Matrix3 rot;
-			rot.SetColumn(0, right);
-			rot.SetColumn(1, Vector3::UNIT_Y);
-			rot.SetColumn(2, dir);
-			//rot = rot.Transpose();
-
-			q.FromRotationMatrix(rot);			
+			Vector3 right = -dir.crossProduct(Vector3::UNIT_Y);
+			Quaternion q; 			
+			q.FromAxes(right,Vector3::UNIT_Y,dir);
 			mPlayerCharacter->setDirection(q); 
-			((MyCharMoveController*)mCharacterController)->movespeed = 0.2;
-		//	mPlayerCharacter->addMovement(Character::DR_Forward);
-		}
+			if(mCharacterController )
+			((MyCharMoveController*)mCharacterController)->movespeed = 1.5;
+			mPlayerCharacter->addMovement(Character::DR_StepRight);
+		//}
 
 	}
@@ -272,5 +253,5 @@
 {
 //	LogManager::getSingleton().logMessage("CHARACTERPLAYER_FRAMESTARTED");
-	doAction();
+	doAction(evt.timeSinceLastFrame);
 
 	float dt = evt.timeSinceLastFrame;
@@ -325,4 +306,5 @@
 		if (inputDevice->isKeyDown(KC_LSHIFT))
 		{
+			if(mCharacterController)
 			((MyCharMoveController*)mCharacterController)->movespeed = 4.0;
 			mRunning = true;
@@ -330,4 +312,5 @@
 		else
 		{
+			if(mCharacterController)
 			((MyCharMoveController*)mCharacterController)->movespeed = 2.0;
 			mRunning = false;
@@ -389,4 +372,5 @@
 	}
 
+	if(mCharacterMeshEntity)
 	this->mCharacterMeshEntity->_updateAnimation();
 
@@ -401,9 +385,7 @@
 		Vector3 translation = mWeaponBoundNode->getWorldPosition();
 		Quaternion orientation = mWeaponBoundNode->getWorldOrientation();
-
-		mCharacterController->mWeaponPosition  = translation;
 		
 		mWeaponBound->setGlobalOrientation(orientation);		
-		//mWeaponBound->moveGlobalPosition(translation);
+		mWeaponBound->setGlobalPosition(translation);
 
 		//mWeaponBound->setGlobalPosition(translation);		
@@ -469,4 +451,7 @@
 void FPSPlayer::setAnimState(PlayerAnimState as)
 {
+	if(!mCharacterMeshEntity)
+		return;
+
 	switch(as)	
 	{
