Changeset 1629 for GTP/trunk/App/Demos/Illum/Ogre/src/CausticTest/include
- Timestamp:
- 10/17/06 09:25:48 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/CausticTest/include/CausticTest.h
r1490 r1629 36 36 protected: 37 37 38 Light* light; 38 39 SceneNode* lightNode; 39 40 SceneNode* sphereNode; … … 41 42 42 43 public: 43 RaytraceDemoListener(RenderWindow* window, Camera* maincam,SceneNode* lightNode, SceneNode* sphereNode )44 RaytraceDemoListener(RenderWindow* window, Camera* maincam,SceneNode* lightNode, SceneNode* sphereNode, Light* l) 44 45 :ExampleFrameListener(window, maincam) 45 46 … … 48 49 this->sphereNode = sphereNode; 49 50 this->lightNode = lightNode; 51 light = l; 50 52 } 51 53 bool processUnbufferedKeyInput(const FrameEvent& evt) … … 57 59 lDir.normalise(); 58 60 lPos -= lDir; 59 lightNode->setPosition(lPos); 61 lightNode->setPosition(lPos); 62 light->setDirection(lDir); 60 63 } 61 64 if (mInputDevice->isKeyDown(KC_ADD)) … … 66 69 lDir.normalise(); 67 70 lPos += lDir; 68 lightNode->setPosition(lPos); 71 lightNode->setPosition(lPos); 72 light->setDirection(lDir); 69 73 } 70 74 if (mInputDevice->isKeyDown(KC_MULTIPLY)) … … 76 80 Vector3 up = lDir.crossProduct(right); 77 81 lPos += up, 78 lightNode->setPosition(lPos); 82 lightNode->setPosition(lPos); 83 light->setDirection(lDir); 79 84 } 80 85 if (mInputDevice->isKeyDown(KC_DIVIDE)) … … 87 92 lPos -= up, 88 93 lightNode->setPosition(lPos); 94 light->setDirection(lDir); 89 95 90 96 } … … 127 133 } 128 134 129 135 Light* light; 130 136 void createScene(void) 131 137 { 132 138 133 139 //createPostproc(); 134 140 OgreIlluminationManager::getSingleton().setBlurShadowMap(true); 141 OgreIlluminationManager::getSingleton().setUseLISPSM(false); 142 135 143 OgreIlluminationManager::getSingleton().setMainCamera(mCamera); 136 144 OgreIlluminationManager::getSingleton().setMainViewport(mWindow->getViewport(0)); … … 159 167 sphereNode->_updateBounds(); 160 168 161 /* 169 162 170 Light* mainLight = mSceneMgr->createLight("MainLight"); 163 mainLight->setType(Light::LT_POINT); 171 light = mainLight; 172 mainLight->setType(Light::LT_DIRECTIONAL); 164 173 mainLight->setDiffuseColour(ColourValue::White); 165 174 mainLight->setSpecularColour(ColourValue::White); … … 176 185 177 186 createPlane("ground", "TestPlane", Vector3(0,0,0), Vector2(500,500)); 178 */187 179 188 OgreIlluminationManager::getSingleton().initTechniques(); 180 189 … … 208 217 mCamera, 209 218 mainLightNode, 210 sphereNode 219 sphereNode, 220 light 211 221 ); 222 mFrameListener->setPriority(1); 223 OgreIlluminationManager::getSingleton().setPriority(2); 212 224 mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); 213 225 mRoot->addFrameListener(mFrameListener);
Note: See TracChangeset
for help on using the changeset viewer.