Ignore:
Timestamp:
03/29/05 08:21:37 (19 years ago)
Author:
gametools
Message:
 
Location:
trunk/VUT/OcclusionCullingSceneManager/TestCulling
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCulling.vcproj

    r29 r32  
    3434                        <Tool 
    3535                                Name="VCLinkerTool" 
    36                                 AdditionalDependencies="OGREMain_d.LIB CEGUIBase_d.lib OgreGUIRenderer_d.lib" 
     36                                AdditionalDependencies="OGREMain_d.LIB CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_OctreeSceneManager.lib" 
    3737                                OutputFile="$(OGRE_PATH)/Samples/Common/bin/Debug/TestCulling.exe" 
    3838                                LinkIncremental="2" 
    39                                 AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\Debug&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\Debug&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;" 
     39                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\Debug&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\Debug&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;" 
    4040                                GenerateDebugInformation="TRUE" 
    4141                                ProgramDatabaseFile="$(OutDir)/TestCulling.pdb" 
  • trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.cpp

    r31 r32  
    106106        mRotateSpeed *= 2; 
    107107         
    108                 mCurrentAlgorithm = OcclusionCullingSceneManager::RENDER_COHERENT; 
     108                mCurrentAlgorithm = OcclusionCullingSceneTraverser::RENDER_COHERENT; 
     109                mThreshold = 0; 
    109110 
    110111                // Register this so that we get mouse events. 
     
    121122                mQueryCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/QueryCulledNodesInfo"); 
    122123        mTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/TraversedNodesInfo"); 
    123                  
    124                 //mMaterialInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/MaterialInfo"); 
    125         //mInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/Info"); 
    126  
     124         
    127125                mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
    128                 mThresholdInfo->setCaption(": dfddfdffdfd0"); 
     126                mThresholdInfo->setCaption(": 0"); 
    129127                mFrustumCulledNodesInfo->setCaption(": 0"); 
    130128                mQueryCulledNodesInfo->setCaption(": 0"); 
     
    191189bool MouseQueryListener::frameEnded(const FrameEvent& evt) 
    192190{ 
     191        if (mShutdownRequested) 
     192                return false; 
     193 
    193194    if (timeDelay >= 0)  
    194195        timeDelay -= evt.timeSinceLastFrame; 
    195196 
    196     KEY_PRESSED(KC_O, 1, changeAlgorithm()); 
    197         //KEY_PRESSED(KC_T, 1, changeAlgorithm()); 
     197    KEY_PRESSED(KC_SPACE, 0.3, changeAlgorithm()); 
     198 
     199        KEY_PRESSED(KC_SUBTRACT, 0.3, changeThreshold(-10)); 
     200        KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 
     201        //KEY_PRESSED(KC_T, 1, change); 
    198202       
    199203        changeStats(); 
     
    202206} 
    203207//----------------------------------------------------------------------- 
     208void MouseQueryListener::changeThreshold(int incr) 
     209{ 
     210        mThreshold += incr; if(mThreshold < 0) mThreshold = 0; 
     211         
     212        char str[100]; sprintf(str,": %d", mThreshold); 
     213 
     214        mSceneMgr->setOption("Threshold", &mThreshold);  
     215        mThresholdInfo->setCaption(str); 
     216} 
     217//----------------------------------------------------------------------- 
    204218void MouseQueryListener::changeAlgorithm() 
    205219{ 
    206     mCurrentAlgorithm = ++mCurrentAlgorithm % OcclusionCullingSceneManager::NUM_RENDERMODES; 
     220    mCurrentAlgorithm = ++mCurrentAlgorithm % OcclusionCullingSceneTraverser::NUM_RENDERMODES; 
    207221 
    208222        mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
     
    214228        unsigned int opt = 0; 
    215229        char str[100]; 
    216         mSceneMgr->getOption("Threshold", &opt); sprintf(str,"%d",opt);mThresholdInfo->setCaption(str); 
    217         mSceneMgr->getOption("NumFrustumCulledNodes", &opt); sprintf(str,"%d",opt); mFrustumCulledNodesInfo->setCaption(str); 
    218         mSceneMgr->getOption("NumQueryCulledNodes", &opt); sprintf(str,"%d",opt);mQueryCulledNodesInfo->setCaption(str); 
    219         mSceneMgr->getOption("NumTraversedNodes", &opt); sprintf(str,"%d",opt);mTraversedNodesInfo->setCaption(str); 
     230         
     231        mSceneMgr->getOption("NumFrustumCulledNodes", &opt); sprintf(str,": %d", opt);  
     232        mFrustumCulledNodesInfo->setCaption(str); 
     233         
     234        mSceneMgr->getOption("NumQueryCulledNodes", &opt); sprintf(str,": %d", opt);  
     235        mQueryCulledNodesInfo->setCaption(str); 
     236         
     237        mSceneMgr->getOption("NumTraversedNodes", &opt); sprintf(str,": %d", opt);  
     238        mTraversedNodesInfo->setCaption(str); 
     239} 
     240//----------------------------------------------------------------------- 
     241void MouseQueryListener::keyPressed(KeyEvent* e) 
     242{ 
     243        if(e->getKey() == KC_ESCAPE) 
     244    { 
     245                mShutdownRequested = true; 
     246                e->consume(); 
     247                return; 
     248        } 
     249 
     250        CEGUI::System::getSingleton().injectKeyDown(e->getKey()); 
     251        CEGUI::System::getSingleton().injectChar(e->getKeyChar()); 
     252        e->consume(); 
     253} 
     254//----------------------------------------------------------------------- 
     255void MouseQueryListener::keyReleased(KeyEvent* e) 
     256{ 
     257        CEGUI::System::getSingleton().injectKeyUp(e->getKey()); 
     258        e->consume(); 
     259} 
     260//----------------------------------------------------------------------- 
     261void MouseQueryListener::keyClicked(KeyEvent* e)  
     262{ 
     263        // Do nothing 
     264        e->consume(); 
    220265} 
    221266//----------------------------------------------------------------------- 
  • trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.h

    r30 r32  
    66#include "ExampleApplication.h" 
    77#include "OgreOcclusionCullingSceneManager.h" 
     8#include "OgreOcclusionCullingSceneTraverser.h" 
    89 
    910Real timeDelay = 0; 
     
    1718} 
    1819 
    19 String mCurrentAlgorithmCaptions[OcclusionCullingSceneManager::NUM_RENDERMODES] =  
     20String mCurrentAlgorithmCaptions[OcclusionCullingSceneTraverser::NUM_RENDERMODES] =  
    2021{ 
    2122    "Cull Frustum",  
     
    5354    // This is when the mouse is clicked, held and dragged. 
    5455    virtual void mouseDragged (MouseEvent *e); 
    55 /* 
    56     void keyPressed(KeyEvent* e) 
    57     { 
    58         if(e->getKey() == KC_ESCAPE) 
    59         { 
    60             mShutdownRequested = true; 
    61             e->consume(); 
    62             return; 
    63         } 
    6456 
    65         CEGUI::System::getSingleton().injectKeyDown(e->getKey()); 
    66                 CEGUI::System::getSingleton().injectChar(e->getKeyChar()); 
    67         e->consume(); 
    68     } 
     57    void keyPressed(KeyEvent* e); 
    6958 
    70         void keyReleased(KeyEvent* e) 
    71         { 
    72                 CEGUI::System::getSingleton().injectKeyUp(e->getKey()); 
    73                 e->consume(); 
    74         } 
    75         void keyClicked(KeyEvent* e)  
    76         { 
    77                 // Do nothing 
    78                 e->consume(); 
    79         } 
     59        void keyReleased(KeyEvent* e); 
     60        void keyClicked(KeyEvent* e); 
    8061 
    81     bool frameEnded(const FrameEvent& evt) 
    82     { 
    83         if (mShutdownRequested) 
    84             return false; 
    85         else 
    86             return ExampleFrameListener::frameEnded(evt); 
    87     } 
    88 */ 
    8962        void changeAlgorithm(); 
     63        void changeThreshold(int incr); 
    9064        void changeStats(); 
    9165 
     
    9670    CEGUI::Renderer *mGUIRenderer;     // cegui renderer 
    9771        SceneNode* mShipNode; 
    98 //      bool mShutdownRequested; 
     72        bool mShutdownRequested; 
    9973        int mCurrentAlgorithm; 
    100          
     74        int mThreshold; 
     75 
    10176        OverlayElement *mAlgorithmInfo; 
    10277        OverlayElement *mThresholdInfo; 
     
    11388    /*TestCullingApplication() 
    11489    { 
    115  
    11690    }*/ 
    11791 
     
    148122 
    149123    }*/ 
    150      
    151  
    152          
    153124}; 
    154125 
Note: See TracChangeset for help on using the changeset viewer.