Changeset 2201 for GTP/trunk/App/Demos/Illum/Ogre/src/PRMDemo/include
- Timestamp:
- 03/07/07 17:36:02 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/PRMDemo/include/PRMDemo.h
r2191 r2201 33 33 34 34 unsigned long framecount; 35 SceneNode* mainLightNode; 36 Light* light; 35 37 36 38 public: 37 PRMDemoFrameListener(RenderWindow* window, Camera* maincam )39 PRMDemoFrameListener(RenderWindow* window, Camera* maincam, SceneNode* lightNode, Light* l) 38 40 :ExampleFrameListener(window, maincam) 39 41 40 42 { 43 mainLightNode = lightNode; 44 light = l; 41 45 framecount = 0; 42 46 mMoveSpeed /= 50.0; … … 44 48 45 49 bool frameStarted(const FrameEvent& evt) 46 { 50 { 51 /*light->setDirection(mCamera->getDirection()); 52 light->setPosition(mCamera->getPosition()); 53 mainLightNode->setPosition(mCamera->getPosition());*/ 47 54 bool result = ExampleFrameListener::frameStarted(evt); 48 55 framecount++; 56 49 57 return result; 50 58 } … … 64 72 SceneNode* kupolaNode; 65 73 SceneNode* mainLightNode; 74 Light* mainLight; 66 75 67 76 void loadResources(void) … … 106 115 OgreIlluminationManager::getSingleton().setShadowMapMaterialName("GTP/Basic/CameraDepth"); 107 116 OgreIlluminationManager::getSingleton().setFocusingSM(false); 108 OgreIlluminationManager::getSingleton().setShadowMapSize( 512);117 OgreIlluminationManager::getSingleton().setShadowMapSize(1024); 109 118 OgreIlluminationManager::getSingleton().setBlurShadowMap(false); 110 119 OgreIlluminationManager::getSingleton().setUseLISPSM(false); … … 124 133 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 125 134 126 127 SceneSerializer s(mSceneMgr);128 DataStreamPtr inputStream;129 //inputStream = ResourceGroupManager::getSingleton().openResource("level.txt"); //towers2.level130 //s.parseScript(inputStream, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);131 132 135 Entity* pillar = mSceneMgr->createEntity("pillar", "pillarShape.mesh"); 133 136 SceneNode* pillarNode = rootNode->createChildSceneNode("pillarnode"); … … 135 138 136 139 137 createPlane("p","GTP/Basic/ShadowReciever/ShadowAccum",Vector3(0,-1 ,0),Vector2(20,20),Vector2(1,1));140 createPlane("p","GTP/Basic/ShadowReciever/ShadowAccum",Vector3(0,-1.3,0),Vector2(20,20),Vector2(1,1)); 138 141 139 142 Light* mainLight = mSceneMgr->createLight("MainLight"); … … 144 147 mainLightNode = rootNode->createChildSceneNode(); 145 148 146 mainLightNode->setPosition( 5,5,5);147 mainLight->setPosition( 5,5,5);148 mainLight->setPowerScale( 5);149 mainLightNode->setPosition(10,10,10); 150 mainLight->setPosition(10,10,10); 151 mainLight->setPowerScale(10); 149 152 mainLight->setDirection(-1,-1, -1); 150 153 mainLight->setSpotlightOuterAngle(Radian(Degree(90))); 151 mainLight->setAttenuation(20, 1, 0, 0);154 mainLight->setAttenuation(20, 0, 0, 0); 152 155 mainLightNode->attachObject(mainLight); 153 156 154 157 BillboardSet* bbs = mSceneMgr->createBillboardSet("bb", 1); 155 bbs->setDefaultDimensions( 5,5);158 bbs->setDefaultDimensions(6,6); 156 159 bbs->createBillboard(Vector3::ZERO, ColourValue::White); 157 160 bbs->setMaterialName("Flare"); … … 160 163 OgreIlluminationManager::getSingleton().initTechniques(); 161 164 }*/ 162 165 /* 163 166 void createScene(void) ///TOWERS 164 167 { … … 212 215 213 216 OgreIlluminationManager::getSingleton().initTechniques(); 214 } 215 /* 217 }*/ 218 216 219 void createScene(void) ///PATHMAP Hangar 217 220 { … … 219 222 //mSceneMgr->setWorldGeometry(occlusion_cfg); 220 223 221 createPostproc();224 //createPostproc(); 222 225 223 226 OgreIlluminationManager::getSingleton().setMainCamera(mCamera); … … 252 255 //createPlane("p","GTP/Basic/ShadowReciever/Depth",Vector3(0,-0.3,0),Vector2(150,150)); 253 256 254 Light*mainLight = mSceneMgr->createLight("MainLight");255 mainLight->setType(Light::LT_ DIRECTIONAL);257 mainLight = mSceneMgr->createLight("MainLight"); 258 mainLight->setType(Light::LT_SPOTLIGHT); 256 259 mainLight->setCastShadows(true); 257 260 mainLight->setDiffuseColour(ColourValue::White); … … 259 262 mainLightNode = rootNode->createChildSceneNode(); 260 263 261 mainLightNode->setPosition( 1000,1000,1000);262 mainLight->setPosition( 1000,1000,1000);264 mainLightNode->setPosition(0,0,0); 265 mainLight->setPosition(0,0,0); 263 266 mainLight->setPowerScale(5); 264 mainLight->setDirection(-1,-1, -1); 267 mainLight->setDirection(0, 0, 1); 268 mainLight->setSpotlightOuterAngle(Radian(Degree(90))); 269 mainLight->setAttenuation(20, 0, 0, 0); 265 270 mainLightNode->attachObject(mainLight); 266 271 267 272 OgreIlluminationManager::getSingleton().initTechniques(); 268 273 } 269 */ 270 void createPlane(Ogre::String _name, Ogre::String _material, Ogre::Vector3 _pos, Ogre::Vector2 _size, Ogre::Vector2 _subdivisions = Ogre::Vector2(1,1)) { 274 275 void createPlane(Ogre::String _name, Ogre::String _material, Ogre::Vector3 _pos, Ogre::Vector2 _size, Ogre::Vector2 _subdivisions = Ogre::Vector2(1,1)) 276 { 271 277 Plane _plane; 272 278 _plane.normal = Vector3::UNIT_Y; … … 291 297 // This is where we instantiate our own frame listener 292 298 mFrameListener= new PRMDemoFrameListener(mWindow, 293 mCamera );299 mCamera, mainLightNode, mainLight ); 294 300 mFrameListener->setPriority(1); 295 301 mRoot->addFrameListener(mFrameListener);
Note: See TracChangeset
for help on using the changeset viewer.