Changeset 2405
- Timestamp:
- 06/05/07 01:59:59 (17 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/src
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h
r2395 r2405 28 28 #include "FPSPlayer.h" 29 29 30 AnimationState* mAnimState ;30 AnimationState* mAnimState = 0; 31 31 bool cullCamera = true; 32 32 Body *throwSphere = 0; … … 69 69 framecount++; 70 70 71 mAnimState->addTime(evt.timeSinceLastFrame * 0.5);71 // mAnimState->addTime(evt.timeSinceLastFrame * 1.0); 72 72 73 73 … … 119 119 mTimeUntilNextToggle = 1; 120 120 } 121 if (mInputDevice->isKeyDown(KC_SYSRQ) && mTimeUntilNextToggle <= 0) 122 { 123 char tmp[20]; 124 sprintf(tmp, "screenshot_%d.png", ++mNumScreenShots); 125 mWindow->writeContentsToFile(tmp); 126 mTimeUntilNextToggle = 0.5; 127 mWindow->setDebugText(String("Wrote ") + tmp); 128 } 121 129 return true; 122 130 } … … 148 156 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Basic"); 149 157 ResourceGroupManager::getSingleton().initialiseResourceGroup("General"); 158 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_EnvMap"); 150 159 ResourceGroupManager::getSingleton().initialiseResourceGroup("PostProc"); 151 160 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Particles"); 152 161 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_PathMap"); 153 162 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Moria"); 154 //ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_EnvMap");155 163 //ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Caustic"); 156 164 } … … 289 297 bbs->setMaterialName("Flare"); 290 298 mainLightNode->attachObject(bbs); 291 299 /* 292 300 Entity* ent = mSceneMgr->createEntity("troll", "troll.mesh"); 293 301 ent->setCastShadows(true); … … 296 304 trollNode->attachObject(ent); 297 305 trollNode->setScale(0.05,0.05,0.05); 298 mAnimState = ent->getAnimationState("stand"); 299 mAnimState->setEnabled(true); 300 301 gFPSPlayer = new FPSPlayer(NXScene, mSceneMgr, Vector3(0.5, 1.8, 0.3), Vector3(15, 1, 15), 1.6, mCamera, false); 302 gFPSPlayer->addPlayerMesh("FPSarm.mesh", 0.02, true); 303 gFPSPlayer->addWeaponModel("sword.mesh", "joint28"); 304 306 mAnimState = ent->getAnimationState("walk"); 307 mAnimState->setEnabled(true);*/ 308 309 // PlayerCharacter::frameListenerPriority = 20; 310 gFPSPlayer = new FPSPlayer(NXScene, mSceneMgr, Vector3(0.5, 1.8, 0.3), Vector3(5, 10, 15), 1.6, mCamera, false); 311 //gFPSPlayer->addPlayerMesh("FPSarm.mesh", 0.02, true); 312 //gFPSPlayer->addWeaponModel("sword.mesh", "joint28"); 313 /* 314 PlayerCharacter* troll = new PlayerCharacter("troll1", NXScene, mSceneMgr, Vector3(1.5, 3.0, 1.2), Vector3(5, 10, 5), false); 315 troll->addPlayerMesh("troll.mesh", 0.05, false);*/ 305 316 for(float i = 0; i< 7; i++) 306 317 { … … 312 323 Body* b = NXScene->createBody("cube.mesh", 313 324 new CubeShape(size, size, size), 314 Vector3(3,size/2.0 + size * (i + 0.01),3),325 Vector3(3,size/2.0 + i * 5.0,3), 315 326 ac); 316 327 b->setCharacterCollisionGroup(NX_CHARACTER_COL_GROUP_PUSHABLE); … … 354 365 mFrameListener->setPriority(10); 355 366 mRoot->addFrameListener(mFrameListener); 356 gFPSPlayer->setPriority(20);357 358 OgreIlluminationManager::getSingleton().setPriority( 30);367 // gFPSPlayer->setPriority(20); 368 // mRoot->addFrameListener(gFPSPlayer); 369 OgreIlluminationManager::getSingleton().setPriority(40); 359 370 mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); 360 371 -
GTP/trunk/App/Demos/Illum/Ogre/src/PRMDemo/include/PRMDemo.h
r2334 r2405 26 26 #include "SceneSerializer.h" 27 27 28 Light* blueLight; 28 29 29 30 // Listener class for frame updates … … 54 55 bool result = ExampleFrameListener::frameStarted(evt); 55 56 framecount++; 57 58 static float t = 0; 59 float dt = evt.timeSinceLastFrame / 4.0; 60 t += dt; 61 62 //blueLight->setDirection(sin(t),sin(t),cos(t)); 63 blueLight->getParentSceneNode()->setPosition(30 * sin(t), 1, 30 * cos(t)); 56 64 57 65 return result; … … 81 89 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Basic"); 82 90 ResourceGroupManager::getSingleton().initialiseResourceGroup("PostProc"); 83 //ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Demo");91 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_PathMap"); 84 92 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_PathMapDemo"); 85 93 } … … 225 233 OgreIlluminationManager::getSingleton().setMainCamera(mCamera); 226 234 OgreIlluminationManager::getSingleton().setMainViewport(mWindow->getViewport(0)); 227 OgreIlluminationManager::getSingleton().setShadowMap Size(512);228 OgreIlluminationManager::getSingleton().setShadowMapMaterialName( "GTP/Basic/Distance_Normalized");235 OgreIlluminationManager::getSingleton().setShadowMapMaterialName(Light::LT_SPOTLIGHT, "GTP/Basic/Distance_Normalized"); 236 OgreIlluminationManager::getSingleton().setShadowMapMaterialName(Light::LT_POINT, "GTP/Basic/Distance_Normalized"); 229 237 OgreIlluminationManager::getSingleton().setFocusingSM(false); 230 238 OgreIlluminationManager::getSingleton().setShadowMapSize(512); … … 253 261 254 262 //createPlane("p","GTP/Basic/ShadowReceiver/Depth",Vector3(0,-0.3,0),Vector2(150,150)); 255 263 /* 256 264 mainLight = mSceneMgr->createLight("MainLight"); 257 265 mainLight->setType(Light::LT_SPOTLIGHT); 258 mainLight->setCastShadows( false);259 mainLight->setDiffuseColour(ColourValue( 0.5,0.8,1,1));266 mainLight->setCastShadows(true); 267 mainLight->setDiffuseColour(ColourValue(1.0,0.5,0.3,1)); 260 268 mainLight->setSpecularColour(ColourValue::White); 261 269 mainLightNode = rootNode->createChildSceneNode(); 262 270 263 271 mainLightNode->setPosition(30,1,0.0); 264 mainLight->setPosition(30,0,0);265 mainLight->setPowerScale( 300);272 //mainLight->setPosition(30,1,0); 273 mainLight->setPowerScale(200); 266 274 mainLight->setDirection(-1, 0, 0); 267 275 mainLight->setSpotlightOuterAngle(Radian(Degree(90))); 268 mainLight->setAttenuation( 50, 0, 1, 0);276 mainLight->setAttenuation(200, 0, 0, 1); 269 277 mainLightNode->attachObject(mainLight); 270 271 272 273 274 Light* blueLight = mSceneMgr->createLight("BlueLight"); 275 blueLight->setType(Light::LT_SPOTLIGHT); 276 blueLight->setCastShadows(false); 277 blueLight->setDiffuseColour(ColourValue(0.0,0.1,1,1)); 278 */ 279 blueLight = mSceneMgr->createLight("BlueLight"); 280 blueLight->setType(Light::LT_POINT); 281 blueLight->setCastShadows(true); 282 blueLight->setDiffuseColour(ColourValue(1,1,1,1)); 278 283 blueLight->setSpecularColour(ColourValue::White); 279 284 SceneNode* blueLightNode = rootNode->createChildSceneNode(); 280 285 281 286 blueLightNode->setPosition(-30,1,0.0); 282 blueLight->setPosition(-30,0,0);283 blueLight->setPowerScale( 300);284 blueLight->setDirection(1, 0, 0);285 blueLight->setSpotlightOuterAngle(Radian(Degree(90)));286 blueLight->setAttenuation( 50, 0, 1, 0);287 //blueLight->setPosition(-30,1,0); 288 blueLight->setPowerScale(200); 289 // blueLight->setDirection(1, 0, 0); 290 // blueLight->setSpotlightOuterAngle(Radian(Degree(90))); 291 blueLight->setAttenuation(200, 0, 0, 1); 287 292 blueLightNode->attachObject(blueLight); 288 293
Note: See TracChangeset
for help on using the changeset viewer.