Changeset 1847 for GTP/trunk/App/Demos/Illum/Ogre/src
- Timestamp:
- 12/05/06 08:57:19 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/src
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/include/ReflectionTest.h
r1735 r1847 28 28 #include "OgreIlluminationManager.h" 29 29 #include "SpriteParticleRenderer.h" 30 30 #include "FrameCapture.h" 31 32 int scene = 1; 33 FrameCapture* capture; 31 34 32 35 // Listener class for frame updates … … 45 48 framecount = 0; 46 49 this->objectNode = objectNode; 50 47 51 } 52 53 void moveCamera() 54 {/* 55 mCamera->yaw(mRotX); 56 mCamera->pitch(mRotY); 57 mCamera->moveRelative(mTranslateVector);*/ 58 59 mCamera->getParentSceneNode()->yaw(mRotX, Node::TransformSpace::TS_WORLD); 60 mCamera->getParentSceneNode()->pitch(mRotY, Node::TransformSpace::TS_LOCAL); 61 mCamera->getParentSceneNode()->translate(mTranslateVector, Node::TransformSpace::TS_LOCAL); 62 63 } 64 48 65 bool processUnbufferedKeyInput(const FrameEvent& evt) 49 66 { … … 124 141 // Move camera down 125 142 mTranslateVector.y = -mMoveScale; 126 } 143 } 144 if (mInputDevice->isKeyDown(KC_N) && mTimeUntilNextToggle <= 0) 145 { 146 capture->playEvent(); 147 mTimeUntilNextToggle = 1; 148 } 149 if (mInputDevice->isKeyDown(KC_B) && mTimeUntilNextToggle <= 0) 150 { 151 capture->recordEvent(); 152 mTimeUntilNextToggle = 1; 153 } 154 if (mInputDevice->isKeyDown(KC_M) && mTimeUntilNextToggle <= 0) 155 { 156 capture->setSaving(); 157 capture->playEvent(); 158 mTimeUntilNextToggle = 1; 159 } 127 160 128 161 if( mInputDevice->isKeyDown( KC_ESCAPE) ) … … 198 231 SceneNode* objectNode; 199 232 233 void createCamera(void) 234 { 235 // Create the camera 236 mCamera = mSceneMgr->createCamera("PlayerCam"); 237 238 SceneNode* camNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("mainCameraNode"); 239 camNode->attachObject(mCamera); 240 camNode->setPosition(Vector3(0,1,0)); 241 // Position it at 500 in Z direction 242 //mCamera->setPosition(Vector3(0,0,500)); 243 // Look back along -Z 244 //mCamera->lookAt(Vector3(0,0,-300)); 245 mCamera->setNearClipDistance(5); 246 247 } 248 200 249 void createScene(void) 201 250 { … … 208 257 Root::getSingleton()._setCurrentSceneManager(mSceneMgr); 209 258 210 mCamera->setPosition(0,1,0);259 //mCamera->setPosition(0,1,0); 211 260 mCamera->setFOVy(Radian(Degree(80))); 212 261 mCamera->setFarClipDistance(200); 213 262 mCamera->setNearClipDistance(0.1); 263 264 SceneNode* cn = mCamera->getParentSceneNode(); 214 265 215 266 OgreIlluminationManager::getSingleton().setFocusingSM(false); … … 219 270 mSceneMgr->setAmbientLight(ColourValue(0.505 * 0.2, 0.897 * 0.2, 0.914 * 0.2)); 220 271 221 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 222 223 Entity* object = mSceneMgr->createEntity("object", "teapot.mesh"); 272 capture = new FrameCapture(mWindow); 273 if(scene == 1) createScene1(); 274 if(scene == 2) createScene2(); 275 276 OgreIlluminationManager::getSingleton().initTechniques(); 277 } 278 279 void createScene1(void) 280 { 281 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 282 283 Entity* object = mSceneMgr->createEntity("object", "teapot.mesh"); 224 284 object->setMaterialName("MetalTeapotMultipleBounce"); 225 285 objectNode = rootNode->createChildSceneNode(); … … 227 287 objectNode->scale(0.5,0.5,0.5); 228 288 //objectNode->scale(0.005,0.005,0.005); 289 objectNode->setPosition(0,1.2,0); 290 objectNode->_updateBounds(); 291 292 capture->addAnimableNode(mCamera->getParentSceneNode()); 293 294 Entity* room = mSceneMgr->createEntity("scene", "difflab.mesh"); 295 //room->setMaterialName("GameTools/Phong"); 296 SceneNode* roomNode = rootNode->createChildSceneNode(); 297 roomNode->attachObject(room); 298 roomNode->_updateBounds(); 299 300 mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE); 301 Light* redLight1 = mSceneMgr->createLight("RedLight1"); 302 redLight1->setType(Light::LT_POINT); 303 redLight1->setCastShadows(false); 304 redLight1->setDiffuseColour(ColourValue(1,0.055, 0.0)); 305 redLight1->setPowerScale(1.6); 306 SceneNode* redLightNode1 = rootNode->createChildSceneNode(); 307 redLightNode1->setPosition(0.05,2.361,-1.07); 308 redLightNode1->attachObject(redLight1); 309 310 Light* greenLight1 = mSceneMgr->createLight("GreenLight1"); 311 greenLight1->setType(Light::LT_POINT); 312 greenLight1->setCastShadows(false); 313 greenLight1->setDiffuseColour(ColourValue(0.362,0.783, 0.685)); 314 greenLight1->setPowerScale(2.0); 315 SceneNode* greenLightNode1 = rootNode->createChildSceneNode(); 316 greenLightNode1->setPosition(1.312,1.313,0); 317 greenLightNode1->attachObject(greenLight1); 318 319 Light* mainBlueLight = mSceneMgr->createLight("MainBlueLight"); 320 mainBlueLight->setType(Light::LT_SPOTLIGHT); 321 mainBlueLight->setCastShadows(true); 322 mainBlueLight->setDiffuseColour(ColourValue(0.395,0.766, 1.0)); 323 mainBlueLight->setPowerScale(5.0); 324 mainBlueLight->setSpotlightRange(Degree(0),Degree(160)); 325 mainBlueLight->setAttenuation(2.5, 0, 1, 0); 326 SceneNode* mainBlueLightNode = rootNode->createChildSceneNode(); 327 mainBlueLightNode->setPosition(-0.546,2.095,1.035); 328 //mainBlueLightNode->rotate(Vector3::UNIT_X, Degree(161.396)); 329 //mainBlueLightNode->rotate(Vector3::UNIT_Y, Degree(53.955)); 330 //mainBlueLightNode->rotate(Vector3::UNIT_Z, Degree(-145.065)); 331 mainBlueLight->setDirection(-1.5,-2.0,1.0); 332 mainBlueLightNode->attachObject(mainBlueLight); 333 } 334 335 void createScene2(void) 336 { 337 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 338 339 Entity* object = mSceneMgr->createEntity("object", "athene.mesh"); 340 object->setMaterialName("MetalTeapotMultipleBounce"); 341 objectNode = rootNode->createChildSceneNode(); 342 objectNode->attachObject(object); 343 //objectNode->scale(0.5,0.5,0.5); 344 objectNode->scale(0.005,0.005,0.005); 229 345 objectNode->setPosition(0,1.2,0); 230 346 objectNode->_updateBounds(); … … 269 385 mainBlueLight->setDirection(-1.5,-2.0,1.0); 270 386 mainBlueLightNode->attachObject(mainBlueLight); 271 272 OgreIlluminationManager::getSingleton().initTechniques();273 274 387 } 275 388 … … 279 392 mFrameListener= new RaytraceDemoListener(mWindow, mCamera, objectNode); 280 393 mFrameListener->setPriority(1); 281 OgreIlluminationManager::getSingleton().setPriority(2); 394 OgreIlluminationManager::getSingleton().setPriority(3); 395 capture->setPriority(2); 396 mRoot->addFrameListener(capture); 282 397 mRoot->addFrameListener(mFrameListener); 283 398 mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); -
GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/scripts/ReflectionTest.vcproj
r1730 r1847 42 42 Name="VCCLCompilerTool" 43 43 Optimization="0" 44 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns "44 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns;..\..\Common\include" 45 45 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE" 46 46 MinimalRebuild="true" … … 133 133 OmitFramePointers="true" 134 134 EnableFiberSafeOptimizations="false" 135 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns "135 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns;..\..\Common\include" 136 136 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE" 137 137 StringPooling="true" … … 211 211 > 212 212 <File 213 RelativePath="..\..\Common\src\FrameCapture.cpp" 214 > 215 </File> 216 <File 217 RelativePath="..\..\Common\include\FrameCapture.h" 218 > 219 </File> 220 <File 213 221 RelativePath="..\include\ReflectionTest.h" 214 222 >
Note: See TracChangeset
for help on using the changeset viewer.