Ignore:
Timestamp:
05/06/05 01:39:32 (19 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCulling/TestCullingApplication.cpp

    r85 r86  
    5454 
    5555        mSceneContentGenerator = new SceneContentGenerator(mSceneMgr); 
    56         mSceneContentGenerator->GenerateScene(330, "robot.mesh"); 
     56        mSceneContentGenerator->GenerateScene(3000, "sphere.mesh"); 
    5757 
    5858        // Create a skybox 
     
    101101                                                                           CEGUI::Renderer *renderer, 
    102102                                                                           SceneContentGenerator *sceneContentGenerator) 
    103         : ExampleFrameListener(win, cam, false, true), mGUIRenderer(renderer),  
    104                 mShutdownRequested(false) 
    105 { 
    106  
    107         // Setup default variables 
    108         //mOgreHead = NULL; 
    109         mLMouseDown = false; 
    110         mRMouseDown = false; 
    111         mSceneMgr = sceneManager; 
    112  
    113         mSceneContentGenerator = sceneContentGenerator; 
    114  
     103: ExampleFrameListener(win, cam, false, true), 
     104mSceneMgr(sceneManager), 
     105mGUIRenderer(renderer),  
     106mShutdownRequested(false),  
     107mUseOptimization(false), 
     108mLMouseDown(false), 
     109mRMouseDown(false), 
     110mSceneContentGenerator(sceneContentGenerator), 
     111mVisibilityThreshold(0), 
     112mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING) 
     113{ 
    115114    // Reduce move speed 
    116115        mMoveSpeed = 50; 
    117116        mRotateSpeed *= 2; 
    118  
    119         mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING; 
    120         mVisibilityThreshold = 0; 
    121      
     117  
    122118        // Register this so that we get mouse events. 
    123119        mEventProcessor->addMouseListener(this); 
     
    137133        mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo"); 
    138134        mNumObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/NumObjectsInfo"); 
     135        mUseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo"); 
    139136 
    140137        mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
     
    146143        mRenderedNodesInfo->setCaption(": 0"); 
    147144        mNumObjectsInfo->setCaption(": 0"); 
     145        mUseOptimizationInfo->setCaption(": true"); 
    148146 
    149147        setAlgorithm(mCurrentAlgorithm); 
     148        toggleUseOptimization(); 
    150149 
    151150    pOver->show(); 
     
    226225        KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10)); 
    227226        KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 
     227        KEY_PRESSED(KC_O, 0.3, toggleUseOptimization()); 
    228228        //KEY_PRESSED(KC_T, 1, change); 
    229229       
     
    250250 
    251251        setAlgorithm(mCurrentAlgorithm); 
     252} 
     253//----------------------------------------------------------------------- 
     254void MouseQueryListener::toggleUseOptimization() 
     255{ 
     256        mUseOptimization = !mUseOptimization; 
     257 
     258        mSceneMgr->setOption("UseOptimization", &mUseOptimization); 
     259 
     260        if(mUseOptimization) 
     261                mUseOptimizationInfo->setCaption(": true"); 
     262        else 
     263                mUseOptimizationInfo->setCaption(": false"); 
     264} 
     265//----------------------------------------------------------------------- 
     266void MouseQueryListener::toggleShowOctree() 
     267{ 
     268        mShowOctree = !mShowOctree; 
     269 
     270        mSceneMgr->setOption("ShowOctree", &mShowOctree); 
    252271} 
    253272//----------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.