Changeset 2377 for GTP/trunk/App/Demos/Illum/Ogre
- Timestamp:
- 05/16/07 08:34:08 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/Moria/include/Moria.h
r2373 r2377 27 27 28 28 AnimationState* mAnimState; 29 29 bool cullCamera = true; 30 30 31 31 // Listener class for frame updates … … 37 37 SceneNode* mainLightNode; 38 38 Light* light; 39 SceneNode* sysNode; 39 40 40 41 public: 41 MoriaDemoFrameListener(RenderWindow* window, Camera* maincam, SceneNode* lightNode, Light* l )42 MoriaDemoFrameListener(RenderWindow* window, Camera* maincam, SceneNode* lightNode, Light* l, SceneNode* sysNode) 42 43 :ExampleFrameListener(window, maincam) 43 44 … … 47 48 framecount = 0; 48 49 mMoveSpeed /= 50.0; 50 this->sysNode = sysNode; 49 51 } 50 52 … … 53 55 float thisTime = (float) Root::getSingleton().getTimer()->getMilliseconds() / 2000.0f; 54 56 55 mainLightNode->setPosition(Vector3( 10*cos(thisTime), 7, 10* sin(thisTime)) + Vector3(5, 0, 5));57 mainLightNode->setPosition(Vector3(2*cos(thisTime), 2, 2 * sin(thisTime)) + Vector3(5, 0, 5)); 56 58 Vector3 pos = light->getDerivedPosition(); 57 59 pos.normalise(); … … 61 63 framecount++; 62 64 63 mAnimState->addTime(evt.timeSinceLastFrame * 0.5); 65 mAnimState->addTime(evt.timeSinceLastFrame * 0.5); 66 67 sysNode->setPosition(mCamera->getPosition() - Vector3(0,1.5,0)); 64 68 65 69 return ExampleFrameListener::frameStarted(evt); 66 70 } 71 72 bool processUnbufferedKeyInput(const FrameEvent& evt) 73 { 74 /*if (mInputDevice->isKeyDown(KC_C)&& mTimeUntilNextToggle <= 0) 75 { 76 cullCamera = ! cullCamera; 77 Root::getSingleton()._getCurrentSceneManager()->setOption("CullCamera", &cullCamera); 78 mTimeUntilNextToggle = 1; 79 }*/ 80 return ExampleFrameListener::processUnbufferedKeyInput(evt); 81 } 67 82 68 83 … … 81 96 SceneNode* mainLightNode; 82 97 Light* mainLight; 98 SceneNode *pSysNode; 83 99 84 100 void loadResources(void) … … 150 166 151 167 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 152 153 168 154 169 SceneSerializer s(mSceneMgr); 155 170 DataStreamPtr inputStream; … … 187 202 mainLightNode->attachObject(mainLight); 188 203 //mainLight->setSpotlightRange(Degree(0),Degree(120)); 189 mainLight->setAttenuation( 40.0, 0, 4, 0);190 204 mainLight->setAttenuation(20.0, 0, 8, 0); 205 /* 191 206 Light* blueLight = mSceneMgr->createLight("blueLight"); 192 207 blueLight->setType(Light::LT_POINT); … … 197 212 SceneNode* blueLightNode = rootNode->createChildSceneNode(); 198 213 blueLightNode->setPosition(15,10,15); 199 blueLightNode->attachObject(blueLight); 214 blueLightNode->attachObject(blueLight);*/ 200 215 201 216 Vector4 v = mainLight->getAs4DVector(); … … 212 227 SceneNode *trollNode = mSceneMgr->getRootSceneNode()->createChildSceneNode( Vector3(5,0,5)); 213 228 trollNode->attachObject(ent); 214 trollNode->setScale(0. 1,0.1,0.1);229 trollNode->setScale(0.05,0.05,0.05); 215 230 mAnimState = ent->getAnimationState("stand"); 216 231 mAnimState->setEnabled(true); 217 232 218 DataStreamPtr res = ResourceGroupManager::getSingleton().openResource("illum.hlsl", "GTP_Moria", true, 0); 219 String content = res->getAsString(); 233 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "MoriaDust"); 234 pSys1->setKeepParticlesInLocalSpace(true); 235 pSysNode = rootNode->createChildSceneNode("psys1"); 236 pSysNode->attachObject(pSys1); 237 pSysNode->setPosition(0,0,0); 220 238 221 239 OgreIlluminationManager::getSingleton().initTechniques(); … … 246 264 // This is where we instantiate our own frame listener 247 265 mFrameListener= new MoriaDemoFrameListener(mWindow, 248 mCamera, mainLightNode, mainLight);266 mCamera, mainLightNode, mainLight, pSysNode ); 249 267 mFrameListener->setPriority(2); 250 268 mRoot->addFrameListener(mFrameListener);
Note: See TracChangeset
for help on using the changeset viewer.