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 2473)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/Moria/scripts/Moria.7.10.vcproj	(revision 2491)
@@ -35,5 +35,5 @@
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="OgreMain_d.lib GTGeometry_d.lib IllumModule_Ogre.lib IllumModule.lib NxOgre_d.lib"
+				AdditionalDependencies="OgreMain_d.lib IllumModule_Ogre.lib IllumModule.lib NxOgre_d.lib"
 				OutputFile="$(OutDir)/Moria.exe"
 				LinkIncremental="1"
@@ -102,5 +102,5 @@
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="OgreMain.lib GTGeometry.lib IllumModule_Ogre.lib IllumModule.lib NxOgre.lib"
+				AdditionalDependencies="OgreMain.lib IllumModule_Ogre.lib IllumModule.lib NxOgre.lib"
 				OutputFile="$(OutDir)/Moria.exe"
 				LinkIncremental="1"
Index: GTP/trunk/App/Demos/Illum/Ogre/src/SpaceStation/include/SpaceStation.h
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/SpaceStation/include/SpaceStation.h	(revision 2472)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/SpaceStation/include/SpaceStation.h	(revision 2491)
@@ -52,6 +52,103 @@
 Entity* LightButton;
 Entity* SmokeButton;
-
-AnimationState* scientistAnimState;
+SceneNode* hlNode;
+SceneNode* rlNode;
+
+int targetCount = 6;
+Vector3 targets[] = {Vector3(-8.5,-1.3, -9.8),
+					Vector3(-9.8,-1.3,-10.7),
+					Vector3(-6.5,-1.3,-11.5),
+					Vector3(-6.3,-1.3,-9.6),
+					Vector3(-7.7,-1.3,-10.6),
+					Vector3(-5.4,-1.3,-10.9)};
+
+class Scientist : FrameListener
+{
+public:
+	Scientist(String name, SceneManager* mSceneMgr)
+	{
+		scientist = mSceneMgr->createEntity(name, "scientist.mesh");
+		mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		mNode->setPosition(-7.5,-1.3,-11);
+		mNode->setScale(0.02,0.02,0.02);
+		mNode->attachObject(scientist);
+		scientist->setCastShadows(true);
+		mNode->_updateBounds();
+		animState = scientist->getAnimationState("idle");
+		animState->setEnabled(true);
+
+		setPriority(20);	
+		Root::getSingleton().addFrameListener(this);
+
+		waitTimer = new Timer();
+		waitTimer->reset();
+
+		wait_min = 2000;
+		wait_max = 5000;
+		waitTime = Math::RangeRandom(wait_min, wait_max);
+
+		targetReached = true;
+		movespeed = 0.2;
+	}
+
+	bool frameStarted(const FrameEvent& evt)
+    {
+		animState->addTime(evt.timeSinceLastFrame * 0.75);
+
+		//mNode->translate(movespeed * 0.001 * Vector3(0,0,1), Node::TS_LOCAL);
+		
+		Vector3 pos = mNode->getWorldPosition();
+		dir = target - pos;
+		if(!targetReached && dir.length() < 0.05)
+		{
+			waitTimer->reset();
+			targetReached = true;
+			animState = scientist->getAnimationState("idle");
+			animState->setEnabled(true);
+			animState->setLoop(true);
+		}
+				
+		if(!targetReached)
+		{
+			//move forward to target
+			mNode->translate(movespeed * 0.1 * Vector3(0,0,1), Node::TS_LOCAL);
+		}
+		else
+		{
+			//look for new target
+			if(waitTimer->getMilliseconds() > waitTime)
+			{
+				int nextTarget = (int)(Math::UnitRandom() * targetCount);
+				target = targets[nextTarget];
+				dir = target - mNode->getWorldPosition();
+				dir.normalise();
+				Vector3 right = -dir.crossProduct(Vector3::UNIT_Y);
+				Quaternion q; 			
+				q.FromAxes(right,Vector3::UNIT_Y, dir);
+				mNode->setOrientation(q);
+
+				targetReached = false;
+				animState = scientist->getAnimationState("walk");
+				animState->setEnabled(true);
+				animState->setLoop(true);
+			}
+		}
+
+		return true;
+	}
+
+	Entity* scientist;
+	SceneNode* mNode;
+	Vector3 target;
+	Vector3 dir;
+	float movespeed;
+	bool targetReached;
+	Timer* waitTimer;
+	AnimationState* animState;
+	int wait_min;
+	int wait_max;
+	int waitTime;
+
+};
 
 // Listener class for frame updates
@@ -86,6 +183,5 @@
     bool frameStarted(const FrameEvent& evt)
     {	
-		scientistAnimState->addTime(evt.timeSinceLastFrame);
-
+		
 		if(smokeOffTimer->getMilliseconds()>10)
 		{
@@ -100,5 +196,7 @@
 		static float rotate = 0;
 		rotate += dt * 100.0;
-		Vector3 dir(Math::Sin(Radian(Degree(rotate))), -1.4,Math::Cos(Radian(Degree(rotate))));
+		hlNode->rotate(Vector3(0,1,0),Radian(-Degree(dt * 100.0)));
+		rlNode->rotate(Vector3(0,1,0),Radian(-Degree(dt * 100.0)));
+		Vector3 dir(Math::Cos(Radian(Degree(rotate))), -1.4,Math::Sin(Radian(Degree(rotate))));
 		dir.normalise();
 		if(light1)
@@ -122,6 +220,10 @@
 		smokeSystem->getEmitter(0)->setEmissionRate(0);
 		smokeOffTimer->reset();
-	}
-	void smokebuttonpressed()
+		Ogre::Material* blueMat = (Ogre::Material*) MaterialManager::getSingleton().getByName("Station/bluebutton").getPointer();
+		blueMat->getTechnique(0)->getPass(0)->setAmbient(0.01,0.01,0.01);
+		if(smokeON)
+			SmokeButton->getParentSceneNode()->translate(0,0.02,0,Node::TS_LOCAL);			
+	}
+	void lightbuttonpressed()
 	{
 		hallLightON = !hallLightON;
@@ -129,9 +231,27 @@
 			if(!hallLightON)
 			{
+				turnSmokeOff();
 				smokeON = false;
-				turnSmokeOff();
+				
+				LightButton->getParentSceneNode()->translate(0,0.02,0,Node::TS_LOCAL);
+				Ogre::Material* redMat = (Ogre::Material*) MaterialManager::getSingleton().getByName("Station/redbutton").getPointer();
+				redMat->getTechnique(0)->getPass(0)->setAmbient(0.1,0.01,0.01);	
+				Ogre::Material* lampMat = (Ogre::Material*) MaterialManager::getSingleton().getByName("Station_lamp").getPointer();
+				lampMat->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("color",Vector4(0,0,0,0));	
+
 			}
-	}
-	void lightbuttonpressed()
+			else
+			{
+				LightButton->getParentSceneNode()->translate(0,-0.02,0,Node::TS_LOCAL);
+				Ogre::Material* redMat = (Ogre::Material*) MaterialManager::getSingleton().getByName("Station/redbutton").getPointer();
+				redMat->getTechnique(0)->getPass(0)->setAmbient(1,0.1,0.1);							
+				Ogre::Material* lampMat = (Ogre::Material*) MaterialManager::getSingleton().getByName("Station_lamp").getPointer();
+				lampMat->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("color",Vector4(20,20,20,20));		
+			}
+			
+			
+						
+	}
+	void smokebuttonpressed()
 	{
 		if(hallLightON)
@@ -143,8 +263,13 @@
 				smokeSystem->setVisible(true);
 				smokeVisible = true;
+
+				SmokeButton->getParentSceneNode()->translate(0,-0.02,0,Node::TS_LOCAL);
+				Ogre::Material* blueMat = (Ogre::Material*) MaterialManager::getSingleton().getByName("Station/bluebutton").getPointer();
+				blueMat->getTechnique(0)->getPass(0)->setAmbient(0.1,0.1,1);				
 			}
 			else
 			{
 				turnSmokeOff();
+				SmokeButton->getParentSceneNode()->translate(0,0.02,0,Node::TS_LOCAL);
 			}
 				
@@ -279,11 +404,11 @@
 			if( dist < 1 && FPSPlayer::thePlayer->getDirection().dotProduct(Vector3(0,0,-1))>0)
 			{
-				if(PlayerPos.x > -1.5375)//lightbutton
+				if(PlayerPos.x > -1.5375)
+				{
+					smokebuttonpressed();
+				}
+				else
 				{
 					lightbuttonpressed();
-				}
-				else//smokebutton
-				{
-					smokebuttonpressed();
 				}
 			}
@@ -466,4 +591,5 @@
 		lbNode->rotate(Vector3(1,0,0), Degree(30.0));
 		lbNode->attachObject(LightButton);
+		lbNode->translate(0,-0.02,0,Node::TS_LOCAL);
 		LightButton->setMaterialName("Station/redbutton");
 		
@@ -474,23 +600,29 @@
 		sbNode->rotate(Vector3(1,0,0), Degree(30.0));
 		sbNode->attachObject(SmokeButton);
-		SmokeButton->setMaterialName("Station/bluebutton");
-
-		Entity* scientist = mSceneMgr->createEntity("scientist", "scientist.mesh");
-		//scientist->setMaterialName("GTP/Diffuse/Disc2Point");
-		SceneNode* aNode = rootNode->createChildSceneNode();
-		aNode->setPosition(-7.5,-1.3,-11);
-		aNode->setScale(0.02,0.02,0.02);
-		aNode->attachObject(scientist);
-		scientist->setCastShadows(true);
-		aNode->_updateBounds();
-		AxisAlignedBox bb4 = scientist->getWorldBoundingBox();
-		AxisAlignedBox bb3 = scientist->getBoundingBox();
-		Ogre::Sphere bs2 = scientist->getWorldBoundingSphere();
-		scientistAnimState = scientist->getAnimationState("idle");
-		scientistAnimState->setEnabled(true);
-
-		PlayerCharacter::frameListenerPriority = 20;
-	
-		gFPSPlayer = new FPSPlayer(NXScene, mSceneMgr, Vector3(0.4, 1.0, 0.35),/* Vector3(-0.6,-0.5,-24)*/Vector3(0, -0.5, 11.5), 1.15, mCamera, false);
+		sbNode->translate(0,-0.02,0,Node::TS_LOCAL);
+		SmokeButton->setMaterialName("Station/bluebutton");		
+
+		Entity* hallLampHolder = mSceneMgr->createEntity("hallLampHolder", "hallLampHolder.mesh");
+		SceneNode* hlhNode = rootNode->createChildSceneNode();
+		hlhNode->setPosition(-1.547, 4.308, -24.242);
+		hlhNode->attachObject(hallLampHolder);
+
+		Entity* hallLamp = mSceneMgr->createEntity("hallLamp", "hallLamp.mesh");
+		hlNode = rootNode->createChildSceneNode();
+		hlNode->setPosition(-1.547, 2.899, -24.242);
+		hlNode->attachObject(hallLamp);
+		hallLamp->setCastShadows(false);
+
+		Entity* roomLamp = mSceneMgr->createEntity("roomLamp", "roomLamp.mesh");
+		rlNode = rootNode->createChildSceneNode();
+		rlNode->setPosition(-7.579, 1.000, -10.831);
+		rlNode->attachObject(roomLamp);	
+		rlNode->rotate(Vector3(0,1,0),Radian(Degree(180)));
+		roomLamp->setCastShadows(false);
+
+		new Scientist("scientist", mSceneMgr);
+		PlayerCharacter::frameListenerPriority = 30;
+	
+		gFPSPlayer = new FPSPlayer(NXScene, mSceneMgr, Vector3(0.4, 1.0, 0.35),/*Vector3(-7.5,0.0,-11)*/Vector3(0, 0.0, 11.5), 1.15, mCamera, false);
 		/*gFPSPlayer->addPlayerMesh("FPSarm.mesh", 0.02, false);
 		gFPSPlayer->addWeaponModel("sword.mesh", "joint28");
