Ignore:
Timestamp:
10/17/06 09:25:48 (18 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/src/CausticTest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/src/CausticTest/include/CausticTest.h

    r1490 r1629  
    3636protected: 
    3737         
     38        Light* light; 
    3839        SceneNode* lightNode; 
    3940        SceneNode* sphereNode; 
     
    4142         
    4243public: 
    43     RaytraceDemoListener(RenderWindow* window, Camera* maincam,SceneNode* lightNode, SceneNode* sphereNode) 
     44    RaytraceDemoListener(RenderWindow* window, Camera* maincam,SceneNode* lightNode, SceneNode* sphereNode, Light* l) 
    4445        :ExampleFrameListener(window, maincam)  
    4546                                  
     
    4849                this->sphereNode = sphereNode; 
    4950                this->lightNode = lightNode; 
     51                light = l; 
    5052    } 
    5153        bool processUnbufferedKeyInput(const FrameEvent& evt) 
     
    5759                        lDir.normalise(); 
    5860                        lPos -= lDir; 
    59                         lightNode->setPosition(lPos);    
     61                        lightNode->setPosition(lPos); 
     62                        light->setDirection(lDir); 
    6063                } 
    6164                if (mInputDevice->isKeyDown(KC_ADD)) 
     
    6669                        lDir.normalise(); 
    6770                        lPos += lDir; 
    68                         lightNode->setPosition(lPos);                    
     71                        lightNode->setPosition(lPos); 
     72                        light->setDirection(lDir); 
    6973                } 
    7074                if (mInputDevice->isKeyDown(KC_MULTIPLY)) 
     
    7680                        Vector3 up = lDir.crossProduct(right); 
    7781                        lPos += up, 
    78                         lightNode->setPosition(lPos);                    
     82                        lightNode->setPosition(lPos); 
     83                        light->setDirection(lDir); 
    7984                } 
    8085                if (mInputDevice->isKeyDown(KC_DIVIDE)) 
     
    8792                        lPos -= up,                      
    8893                        lightNode->setPosition(lPos); 
     94                        light->setDirection(lDir); 
    8995                                 
    9096                } 
     
    127133        } 
    128134     
    129  
     135        Light* light; 
    130136        void createScene(void) 
    131137    { 
    132138 
    133139                //createPostproc(); 
    134                  
     140                OgreIlluminationManager::getSingleton().setBlurShadowMap(true); 
     141                OgreIlluminationManager::getSingleton().setUseLISPSM(false); 
     142 
    135143                OgreIlluminationManager::getSingleton().setMainCamera(mCamera); 
    136144                OgreIlluminationManager::getSingleton().setMainViewport(mWindow->getViewport(0)); 
     
    159167                sphereNode->_updateBounds(); 
    160168 
    161 /* 
     169 
    162170                Light* mainLight = mSceneMgr->createLight("MainLight"); 
    163                 mainLight->setType(Light::LT_POINT); 
     171                light = mainLight; 
     172                mainLight->setType(Light::LT_DIRECTIONAL); 
    164173        mainLight->setDiffuseColour(ColourValue::White); 
    165174                mainLight->setSpecularColour(ColourValue::White); 
     
    176185 
    177186                createPlane("ground", "TestPlane", Vector3(0,0,0), Vector2(500,500)); 
    178         */ 
     187         
    179188                OgreIlluminationManager::getSingleton().initTechniques(); 
    180189                 
     
    208217                                                                                        mCamera, 
    209218                                                                                        mainLightNode, 
    210                                                                                         sphereNode 
     219                                                                                        sphereNode, 
     220                                                                                        light 
    211221                                                                                        ); 
     222                mFrameListener->setPriority(1); 
     223                OgreIlluminationManager::getSingleton().setPriority(2); 
    212224        mRoot->addFrameListener(&OgreIlluminationManager::getSingleton()); 
    213225                mRoot->addFrameListener(mFrameListener); 
  • GTP/trunk/App/Demos/Illum/Ogre/src/CausticTest/scripts/CausticTest.vcproj

    r1450 r1629  
    145145                </Filter> 
    146146                <Filter 
    147                         Name="Header Files" 
    148                         Filter="h;hpp;hxx;hm;inl;inc"> 
    149                         <File 
    150                                 RelativePath="..\include\CausticTest.h"> 
    151                         </File> 
    152                 </Filter> 
    153                 <Filter 
    154147                        Name="Resource Files" 
    155148                        Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> 
     149                        <File 
     150                                RelativePath="..\..\..\Media\materials\scripts\GameTools.material"> 
     151                        </File> 
    156152                        <File 
    157153                                RelativePath="..\..\..\Media\materials\scripts\GameTools.program"> 
     
    163159                                RelativePath="..\..\..\Media\materials\scripts\GlassHead.material"> 
    164160                        </File> 
     161                        <Filter 
     162                                Name="Header Files" 
     163                                Filter="h;hpp;hxx;hm;inl;inc"> 
     164                                <File 
     165                                        RelativePath="..\include\CausticTest.h"> 
     166                                </File> 
     167                        </Filter> 
    165168                </Filter> 
    166169        </Files> 
Note: See TracChangeset for help on using the changeset viewer.