Changeset 2305


Ignore:
Timestamp:
04/02/07 11:50:12 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp

    r2290 r2305  
    1111#include "TestCullingTerrainApplication.h" 
    1212#include <string> 
     13 
    1314 
    1415//-- captions for overlays 
     
    521522                setCurrentFrameInfo(evt.timeSinceLastFrame); 
    522523 
    523                 // HACK for demo: save new frame rates for different methods on the  
    524                 // same walkthrough 
     524                // HACK for demo: save new frame rates for the same walkthrough 
    525525                if (mSavePrecomputedFps) 
    526526                { 
     
    758758bool TerrainFrameListener::processUnbufferedMouseInput(const FrameEvent& evt) 
    759759{ 
    760         /* Rotation factors, may not be used if the second mouse button is pressed. */ 
    761  
    762     /* If the second mouse button is pressed, then the mouse movement results in  
    763        sliding the camera, otherwise we rotate. */ 
     760        // Rotation factors, may not be used if the second mouse button is pressed. 
     761    // If the second mouse button is pressed, then the mouse movement results in  
     762    // sliding the camera, otherwise we rotate. 
    764763    if (mInputDevice->getMouseButton(1)) 
    765764    { 
     
    14991498                break; 
    15001499        case KC_7: 
    1501                 mTerrainContentGenerator->WriteObjects(objects_out_filename); 
     1500                { 
     1501                        // generate new objects 
     1502                        const int numObjects = 500; 
     1503                        mApplication->generateScene(numObjects, mCurrentObjectType); 
     1504                } 
    15021505                break; 
    15031506        case KC_8: 
     
    15501553 
    15511554        case KC_F8: 
    1552                 {        
    1553                         // generate new objects 
    1554                         const int objNum = 500; 
    1555                         mApplication->generateScene(objNum, mCurrentObjectType); 
    1556                 } 
    1557                 break; 
     1555 
     1556                mTerrainContentGenerator->WriteObjects(objects_out_filename); 
     1557                break; 
     1558 
    15581559        case KC_F9: 
    15591560                mUseAnimation = !mUseAnimation; 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h

    r2168 r2305  
    4242        void Reset() 
    4343        { 
    44                 mAccFps = mBestFps = mWorstFps = mAccTris = mAccQueryCulledNodes = mAccFrustumCulledNodes = mFrameCount = mAccRenderedNodes = 0; 
     44                mAccFps = 0; 
     45                mBestFps = 0; 
     46                mWorstFps = 0; 
     47                mAccTris = 0; 
     48                mAccQueryCulledNodes = 0; 
     49                mAccFrustumCulledNodes = 0; 
     50                mFrameCount = mAccRenderedNodes = 0; 
    4551        } 
    4652 
    47         void UpdateFrame(int currentFps, int bestFps, int worstFps, int renderedTris, int renderedNodes, int queryCulledNodes, int frustumCulledNodes) 
     53        void UpdateFrame(int currentFps,  
     54                                         int bestFps,  
     55                                         int worstFps,  
     56                                         int renderedTris,  
     57                                         int renderedNodes,  
     58                                         int queryCulledNodes,  
     59                                         int frustumCulledNodes) 
    4860        { 
    4961                mAccFps += currentFps; 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r2290 r2305  
    173173void TestCullingTerrainApplication::loadConfig(const String& filename) 
    174174{ 
    175         // TODO matt 
    176175        // Set up the options 
    177176        ConfigFile config; 
     
    191190                 LogManager::getSingleton().logMessage(d.str()); 
    192191        } 
    193  
    194 /*      val = config.getSetting("ViewCells"); 
    195  
    196         if (!val.empty()) 
    197         { 
    198                  mViewCellsFilename = val.c_str(); 
    199                  std::stringstream d; d << "view cells file name: " << mViewCellsFilename; 
    200                  LogManager::getSingleton().logMessage(d.str()); 
    201         } 
    202  
    203         mInitialPosition = Vector3::UNIT_SCALE; 
    204  
    205         val = config.getSetting("ViewX"); 
    206  
    207         if (!val.empty()) 
    208                 mInitialPosition.x = atof( val.c_str() ); 
    209  
    210         val = config.getSetting("ViewY"); 
    211          
    212         if (!val.empty()) 
    213                 mInitialPosition.y = atof(val.c_str()); 
    214  
    215         val = config.getSetting("ViewZ"); 
    216          
    217         if (!val.empty()) 
    218                 mInitialPosition.z = atof( val.c_str()); 
    219 */ 
    220  
    221 /*      val = config.getSetting("OnlineCullingAlgorithm"); 
    222  
    223         if (!val.empty()) 
    224         { 
    225                  if (val == "CHC") 
    226                  { 
    227                          mAlgorithm =  
    228                                  GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING; 
    229                  } 
    230                  else if (val == "SWC") 
    231                  { 
    232                          mAlgorithm =  
    233                                  GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING; 
    234                  } 
    235                  else if (val == "VFC") 
    236                  { 
    237                          mAlgorithm =  
    238                                  GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING; 
    239                  } 
    240                  else // default rendering 
    241                  { 
    242                          mAlgorithm =  
    243                                  GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS; 
    244                  } 
    245         } 
    246  
    247         ///////////// 
    248         // setup scene 
    249  
    250         // set camera position accordingly 
    251         mCamNode->setPosition(mInitialPosition); 
    252         */ 
    253192} 
    254193//----------------------------------------------------------------------- 
     
    348287        if (daeDoc->doImport(daeName)) 
    349288        { 
    350                 LogManager::getSingleton().logMessage("yuppi"); 
     289                LogManager::getSingleton().logMessage("loading collada"); 
    351290                /** 
    352291                 * build up scene 
Note: See TracChangeset for help on using the changeset viewer.