- Timestamp:
- 10/17/06 09:25:48 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsRaytraceDemo/include/GameToolsRaytraceDemo.h
r1487 r1629 41 41 SceneNode* aluSphereNode; 42 42 SceneNode* lightNode; 43 Light* light; 43 44 unsigned long framecount; 44 45 … … 48 49 SceneNode* silverSphereNode, 49 50 SceneNode* copperSphereNode, 50 SceneNode* aluSphereNode) 51 SceneNode* aluSphereNode, 52 Light* light) 51 53 :ExampleFrameListener(window, maincam) 52 54 … … 58 60 this->aluSphereNode = aluSphereNode; 59 61 this->lightNode = lightNode; 62 this->light = light; 60 63 } 61 64 bool processUnbufferedKeyInput(const FrameEvent& evt) … … 108 111 109 112 lightNode->setPosition( 100.0 * Vector3(cos(-(float)framecount/500.0),2.0,sin(-(float)framecount/500.0))); 110 //lightNode->setDirection(-lightNode->getPosition());113 light->setDirection(Vector3(0,100,0)-lightNode->getPosition()); 111 114 112 115 goldSphereNode->setPosition( 100.0 * … … 145 148 146 149 public: 147 /* virtual void go(void) 148 { 149 if (!setup()) 150 return; 151 152 renderScene(); 153 154 // clean up 155 destroyScene(); 156 } 157 */ 150 158 151 159 152 protected: … … 164 157 SceneNode* copperSphereNode; 165 158 SceneNode* aluSphereNode; 166 /* 167 void renderScene(){ 168 169 mWindow->resetStatistics(); 170 while(true){ 171 172 173 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 174 // Pump events on Win32 175 MSG msg; 176 while( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) ) 177 { 178 TranslateMessage( &msg ); 179 DispatchMessage( &msg ); 180 } 181 182 #endif 183 184 if(!mRoot->_fireFrameStarted()){ 185 break; 186 } 187 unsigned long framenum = mRoot->getCurrentFrameNumber(); 188 189 OgreIlluminationManager::getSingleton().update(framenum, mWindow); 190 191 //mRoot->renderOneFrame(); 192 mRoot->_updateAllRenderTargets(); 193 194 mRoot->_fireFrameEnded(); 195 196 } 197 }*/ 159 Light* mainLight; 160 198 161 199 162 void createPostproc() … … 302 265 303 266 //Init lights 304 Light*mainLight = mSceneMgr->createLight("MainLight");305 mainLight->setType(Light::LT_ POINT);267 mainLight = mSceneMgr->createLight("MainLight"); 268 mainLight->setType(Light::LT_SPOTLIGHT); 306 269 mainLight->setDiffuseColour(ColourValue::White); 307 270 mainLight->setSpecularColour(ColourValue::White); 271 mainLight->setSpotlightRange(Radian(Degree(175)),Radian(Degree(180))); 308 272 mainLightNode = rootNode->createChildSceneNode(); 309 273 mainLightNode->setPosition(0,0,0); 310 274 mainLight->setPosition(mainLightNode->getWorldPosition()); 311 275 mainLightNode->attachObject(mainLight); 312 276 BillboardSet* bbs = mSceneMgr->createBillboardSet("bb", 1); 277 bbs->setDefaultDimensions(10,10); 278 bbs->createBillboard(Vector3::ZERO, ColourValue::White); 279 bbs->setMaterialName("Flare"); 280 mainLightNode->attachObject(bbs); 313 281 aluSphere->setMaterialName("EnvMetals/Alu"); 314 282 copperSphere->setMaterialName("EnvMetals/Copper"); … … 340 308 silverSphereNode, 341 309 copperSphereNode, 342 aluSphereNode); 343 mRoot->addFrameListener(mFrameListener); 310 aluSphereNode, 311 mainLight); 312 mFrameListener->setPriority(1); 313 OgreIlluminationManager::getSingleton().setPriority(2); 314 mRoot->addFrameListener(mFrameListener); 344 315 mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); 345 316
Note: See TracChangeset
for help on using the changeset viewer.