Changeset 2415 for GTP/trunk/App
- Timestamp:
- 06/06/07 10:25:35 (17 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/Common/src/FPSPlayer.cpp
r2413 r2415 112 112 { 113 113 mCharacterMeshEntity = mSceneManager->createEntity(mName, meshname); 114 mCharacterMeshEntity->setCastShadows( true);114 mCharacterMeshEntity->setCastShadows(false); 115 115 mMeshScale = meshscale; 116 116 mCurrentAnimState = PLAYERANIMSTATE_STAND; … … 177 177 178 178 mWeaponEntity = mSceneManager->createEntity(mName + "_Weapon", meshname); 179 mWeaponEntity->setCastShadows(false); 179 180 mWeaponAttachBone = mCharacterMeshEntity->getSkeleton()->getBone(attachBoneName); 180 181 mWeaponNode = mCharacterMeshEntity->getParentSceneNode()->createChildSceneNode(mName+"_WeaponNode"); … … 342 343 { 343 344 float animspeed = 1.2; 344 if(mCurrentAnimState == PLAYERANIMSTATE_WALK && !mRunning) 345 animspeed /= 2; 345 if(mCurrentAnimState == PLAYERANIMSTATE_WALK && mRunning) 346 animspeed *= 1.5; 347 if(mCurrentAnimState == PLAYERANIMSTATE_ATTACK) 348 animspeed *= 2.0; 346 349 347 350 mCharacterMesh_AnimState->addTime(dt*animspeed); … … 351 354 352 355 float movecameraup = 0; 353 if(mDebug)movecameraup = 1.0;356 if(mDebug)movecameraup = 20.0; 354 357 355 358 if(mMoving) -
GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h
r2413 r2415 38 38 bool PP_dofON = true; 39 39 40 float lightpower = 32.0; 40 Real lightpower = 32.0; 41 Real glowCut = 50.6; 42 Real glowTimeBlur = 0.6; 43 Real glowStrech = 1.8; 44 Real glowCombine = 0.5; 41 45 // Listener class for frame updates 42 46 class MoriaDemoFrameListener : public ExampleFrameListener … … 65 69 { 66 70 float thisTime = (float) Root::getSingleton().getTimer()->getMilliseconds() / 2000.0f; 67 71 thisTime= 0; 68 72 mainLightNode->setPosition(Vector3(2*cos(thisTime), 2, 2 * sin(thisTime)) + Vector3(5, 0, 5)); 69 73 Vector3 pos = light->getDerivedPosition(); … … 77 81 78 82 79 sysNode->setPosition(mCamera->getPosition() - Vector3(0,1.5,0)); 83 //sysNode->setPosition(mCamera->getPosition() - Vector3(0,1.5,0)); 84 //sysNode->setPosition(FPSPlayer::thePlayer->getPosition() - Vector3(0,1.5,0)); 80 85 81 86 return ExampleFrameListener::frameStarted(evt); … … 88 93 if (mInputDevice->isKeyDown(KC_ADD) && mTimeUntilNextToggle <= 0) 89 94 { 90 lightpower *= 1.2; 95 if (mInputDevice->isKeyDown(KC_RSHIFT)) 96 lightpower /= 1.2; 97 else 98 lightpower *= 1.2; 91 99 light->setPowerScale(lightpower); 92 mTimeUntilNextToggle = 1; 100 mTimeUntilNextToggle = 0.2; 101 mWindow->setDebugText(String("LightPower ") + StringConverter::toString(lightpower)); 93 102 } 94 103 if (mInputDevice->isKeyDown(KC_SUBTRACT) && mTimeUntilNextToggle <= 0) 95 104 { 96 lightpower /= 1.2; 97 light->setPowerScale(lightpower); 98 mTimeUntilNextToggle = 1; 99 } 105 if (mInputDevice->isKeyDown(KC_RSHIFT)) 106 glowCut /= 1.2; 107 else 108 glowCut *= 1.2; 109 Ogre::Material* m = (Ogre::Material*) MaterialManager::getSingleton().getByName("GTP/Moria/PostProc/GlowCut").getPointer(); 110 m->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("cutValue",glowCut); 111 mTimeUntilNextToggle = 0.2; 112 mWindow->setDebugText(String("GlowCut ") + StringConverter::toString(glowCut)); 113 } 114 if (mInputDevice->isKeyDown(KC_MULTIPLY) && mTimeUntilNextToggle <= 0) 115 { 116 if (mInputDevice->isKeyDown(KC_RSHIFT)) 117 glowTimeBlur /= 1.2; 118 else 119 glowTimeBlur *= 1.2; 120 Ogre::Material* m = (Ogre::Material*) MaterialManager::getSingleton().getByName("GTP/Moria/PostProc/GlowCut").getPointer(); 121 m->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("timeBlur", glowTimeBlur); 122 mTimeUntilNextToggle = 0.2; 123 mWindow->setDebugText(String("GlowTimeBlur ") + StringConverter::toString(glowTimeBlur)); 124 } 125 if (mInputDevice->isKeyDown(KC_M)) 126 { 127 if (mInputDevice->isKeyDown(KC_RSHIFT)) 128 glowStrech -= 0.01; 129 else 130 glowStrech += 0.01; 131 Ogre::Material* m = (Ogre::Material*) MaterialManager::getSingleton().getByName("GTP/Moria/PostProc/GlowBlurH").getPointer(); 132 m->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("Stretch", glowStrech); 133 m = (Ogre::Material*) MaterialManager::getSingleton().getByName("GTP/Moria/PostProc/GlowBlurV").getPointer(); 134 m->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("Stretch", glowStrech); 135 mWindow->setDebugText(String("GlowStretch ") + StringConverter::toString(glowStrech)); 136 } 137 if (mInputDevice->isKeyDown(KC_N)) 138 { 139 if (mInputDevice->isKeyDown(KC_RSHIFT)) 140 glowCombine -= 0.01; 141 else 142 glowCombine += 0.01; 143 Ogre::Material* m = (Ogre::Material*) MaterialManager::getSingleton().getByName("GTP/Moria/GlowFinalCombine").getPointer(); 144 m->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("weight2", glowCombine); 145 mTimeUntilNextToggle = 0.2; 146 mWindow->setDebugText(String("GlowCombine ") + StringConverter::toString(glowCombine)); 147 } 148 100 149 if (mInputDevice->isKeyDown(KC_3) && mTimeUntilNextToggle <= 0) 101 150 { 102 151 PP_glowON = !PP_glowON; 103 152 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), 104 "GTP/ PostProc/Glow", PP_glowON);105 mTimeUntilNextToggle = 1;153 "GTP/Moria/PostProc/Glow", PP_glowON); 154 mTimeUntilNextToggle = 0.2; 106 155 } 107 156 if (mInputDevice->isKeyDown(KC_4) && mTimeUntilNextToggle <= 0) … … 112 161 "GTP/PostProc/ToneMap", PP_tonemapON); 113 162 114 mTimeUntilNextToggle = 1;163 mTimeUntilNextToggle = 0.2; 115 164 } 116 165 if (mInputDevice->isKeyDown(KC_5) && mTimeUntilNextToggle <= 0) … … 119 168 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), 120 169 "GTP/Moria/PostProc/DoF", PP_dofON); 121 mTimeUntilNextToggle = 1;170 mTimeUntilNextToggle = 0.2; 122 171 } 123 172 … … 184 233 void createPostproc() 185 234 { 235 186 236 CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0), 187 237 "GTP/Moria/PostProc/DoF"); … … 189 239 "GTP/Moria/PostProc/DoF", true); 190 240 191 CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),192 "GTP/ PostProc/Glow");241 CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0), 242 "GTP/Moria/PostProc/Glow"); 193 243 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), 194 "GTP/ PostProc/Glow", true);195 196 197 CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),244 "GTP/Moria/PostProc/Glow", true); 245 246 247 CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0), 198 248 "GTP/PostProc/ToneMap"); 199 249 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), 200 250 "GTP/PostProc/ToneMap", true); 251 252 253 254 255 201 256 202 257 /* … … 292 347 293 348 mainLightNode->setPosition(15,5,15); 294 mainLight->setPowerScale(1 00);349 mainLight->setPowerScale(165); 295 350 //mainLight->setDirection(1,0, 0); 296 351 mainLightNode->attachObject(mainLight); … … 315 370 bbs->setMaterialName("Flare"); 316 371 mainLightNode->attachObject(bbs); 317 /* 318 Entity* ent = mSceneMgr->createEntity("troll", "troll.mesh");372 373 /* Entity* ent = mSceneMgr->createEntity("troll", "troll.mesh"); 319 374 ent->setCastShadows(true); 320 375 // Add entity to the scene node … … 322 377 trollNode->attachObject(ent); 323 378 trollNode->setScale(0.05,0.05,0.05); 324 mAnimState = ent->getAnimationState(" walk");379 mAnimState = ent->getAnimationState("stand"); 325 380 mAnimState->setEnabled(true);*/ 326 381 … … 329 384 gFPSPlayer->addPlayerMesh("FPSarm.mesh", 0.02, true); 330 385 gFPSPlayer->addWeaponModel("sword.mesh", "joint28"); 331 /* 386 332 387 PlayerCharacter* troll = new PlayerCharacter("troll1", NXScene, mSceneMgr, Vector3(1.5, 3.0, 1.2), Vector3(5, 10, 5), false); 333 388 troll->addPlayerMesh("troll.mesh", 0.05, false); 334 389 /* 335 390 for(float i = 0; i< 7; i++) 336 391 { … … 347 402 } 348 403 */ 349 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "MoriaDust");404 /* ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "MoriaDust"); 350 405 pSys1->setKeepParticlesInLocalSpace(true); 351 406 pSysNode = rootNode->createChildSceneNode("psys1"); 352 407 pSysNode->attachObject(pSys1); 353 pSysNode->setPosition(0,0,0); 408 pSysNode->setPosition(0,0,0);*/ 354 409 355 410
Note: See TracChangeset
for help on using the changeset viewer.