Changeset 2391 for GTP/trunk/App/Demos
- Timestamp:
- 05/23/07 13:19:50 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/src/Moria
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h
r2388 r2391 26 26 #include "NXOgre.h" 27 27 #include "SceneSerializer.h" 28 #include "FPSPlayer.h" 28 29 29 30 AnimationState* mAnimState; … … 31 32 Body *throwSphere = 0; 32 33 Scene* NXScene = 0; 34 FPSPlayer* gFPSPlayer; 33 35 34 36 // Listener class for frame updates … … 52 54 mMoveSpeed /= 50.0; 53 55 this->sysNode = sysNode; 56 54 57 } 55 58 … … 67 70 68 71 mAnimState->addTime(evt.timeSinceLastFrame * 0.5); 69 70 sysNode->setPosition(mCamera->getPosition() - Vector3(0,1.5,0)); 72 73 74 // sysNode->setPosition(mCamera->getPosition() - Vector3(0,1.5,0)); 71 75 72 76 return ExampleFrameListener::frameStarted(evt); … … 75 79 bool processUnbufferedKeyInput(const FrameEvent& evt) 76 80 { 81 gFPSPlayer->processKeyInputs(mInputDevice); 82 83 static float lastTime = 0; 84 static Timer* t = Root::getSingleton().getTimer(); 85 float thisTime = (float) t->getMilliseconds() / 1000.0f; 86 float dt = thisTime-lastTime; 87 lastTime = thisTime; 88 77 89 78 90 if (mInputDevice->isKeyDown(KC_SPACE)) { … … 92 104 93 105 } 94 return ExampleFrameListener::processUnbufferedKeyInput(evt); 95 } 96 97 98 106 107 108 //return ExampleFrameListener::processUnbufferedKeyInput(evt); 109 110 if( mInputDevice->isKeyDown( KC_ESCAPE) ) 111 { 112 return false; 113 } 114 if (mInputDevice->isKeyDown(KC_F) && mTimeUntilNextToggle <= 0) 115 { 116 mStatsOn = !mStatsOn; 117 showDebugOverlay(mStatsOn); 118 119 mTimeUntilNextToggle = 1; 120 } 121 return true; 122 } 123 124 bool processUnbufferedMouseInput(const FrameEvent& evt) 125 { 126 gFPSPlayer->processMouseInputs(mInputDevice); 127 return true; 128 } 99 129 }; 100 130 … … 128 158 void createPostproc() 129 159 { 130 /*CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),160 CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0), 131 161 "GTP/PostProc/Glow"); 132 162 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), … … 136 166 "GTP/PostProc/ToneMap"); 137 167 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), 138 "GTP/PostProc/ToneMap", true); */139 140 CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),168 "GTP/PostProc/ToneMap", true); 169 170 /* CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0), 141 171 "GTP/PostProc/Plain"); 142 172 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), 143 "GTP/PostProc/Plain", true); 173 "GTP/PostProc/Plain", true); */ 144 174 145 175 } … … 156 186 //mSceneMgr->setWorldGeometry(occlusion_cfg); 157 187 158 //createPostproc();188 createPostproc(); 159 189 160 190 OgreIlluminationManager::getSingleton().setMainCamera(mCamera); … … 185 215 inputStream = ResourceGroupManager::getSingleton().openResource("moria.level"); //towers2.level 186 216 World* NXWorld = new World("FrameListener: yes, log: html"); 187 NXScene = NXWorld->createScene("Main", mSceneMgr, "gravity: yes, floor: yes");217 NXScene = NXWorld->createScene("Main", mSceneMgr, "gravity: yes, floor: no"); 188 218 s.setScene(NXScene); 189 219 s.setWorld(NXWorld); 190 220 s.parseScript(inputStream, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 191 221 s.parseEntryPoints("prmEntryPoints.text"); 222 223 NXScene->createActor("FakeFloor", new CubeShape(100,2,100), Vector3(0,-1,0), "static: yes"); 224 192 225 /* 193 226 Body* b = NXScene->createBody("ize", … … 225 258 226 259 mainLightNode->setPosition(15,5,15); 227 mainLight->setPowerScale( 30);260 mainLight->setPowerScale(20); 228 261 //mainLight->setDirection(1,0, 0); 229 262 mainLightNode->attachObject(mainLight); 230 263 //mainLight->setSpotlightRange(Degree(0),Degree(120)); 231 mainLight->setAttenuation( 20.0, 0, 8, 0);264 mainLight->setAttenuation(1000.0, 0, 8, 0); 232 265 /* 233 266 Light* blueLight = mSceneMgr->createLight("blueLight"); … … 258 291 mAnimState->setEnabled(true); 259 292 293 gFPSPlayer = new FPSPlayer(NXScene, mSceneMgr, Vector3(0.1, 0.6, 0.1), Vector3(5, 10, 5), 0.5, mCamera); 294 gFPSPlayer->addPlayerMesh("FPSarm.mesh", 0.005, true); 295 gFPSPlayer->addWeaponModel("sword.mesh", "joint28"); 296 297 for(float i = 0; i< 10; i++) 298 { 299 ActorParams ac; 300 ac.setToDefault(); 301 ac.mass = 10.0; 302 ac.nodescale = 1.0; 303 NXScene->createBody("cube.mesh", 304 new CubeShape(1, 1, 1), 305 Vector3(3,i,3), 306 ac); 307 } 308 309 /* 260 310 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "MoriaDust"); 261 311 pSys1->setKeepParticlesInLocalSpace(true); … … 263 313 pSysNode->attachObject(pSys1); 264 314 pSysNode->setPosition(0,0,0); 315 */ 265 316 266 317 OgreIlluminationManager::getSingleton().initTechniques(); … … 292 343 mFrameListener= new MoriaDemoFrameListener(mWindow, 293 344 mCamera, mainLightNode, mainLight, pSysNode ); 294 mFrameListener->setPriority(2);345 mFrameListener->setPriority(2); 295 346 mRoot->addFrameListener(mFrameListener); 296 OgreIlluminationManager::getSingleton().setPriority(3); 297 mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); 347 gFPSPlayer->setPriority(3); 348 mRoot->addFrameListener(gFPSPlayer); 349 OgreIlluminationManager::getSingleton().setPriority(4); 350 mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); 351 298 352 } 299 353 -
GTP/trunk/App/Demos/Illum/Ogre/src/Moria/scripts/Moria.7.10.vcproj
r2388 r2391 141 141 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> 142 142 <File 143 RelativePath="..\..\Common\src\FPSPlayer.cpp"> 144 </File> 145 <File 143 146 RelativePath="..\src\Moria.cpp"> 144 147 </File> … … 147 150 Name="Header Files" 148 151 Filter="h;hpp;hxx;hm;inl;inc"> 152 <File 153 RelativePath="..\..\Common\include\FPSPlayer.h"> 154 </File> 149 155 <File 150 156 RelativePath="..\include\Moria.h">
Note: See TracChangeset
for help on using the changeset viewer.