Ignore:
Timestamp:
02/08/07 11:42:53 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1816 r2101  
    192192        } 
    193193 
    194         val = config.getSetting("ViewCells"); 
     194/*      val = config.getSetting("ViewCells"); 
    195195 
    196196        if (!val.empty()) 
     
    218218                mInitialPosition.z = atof( val.c_str()); 
    219219 
    220  
    221         val = config.getSetting("OnlineCullingAlgorithm"); 
     220*/ 
     221/*      val = config.getSetting("OnlineCullingAlgorithm"); 
    222222 
    223223        if (!val.empty()) 
     
    248248        // setup scene 
    249249 
    250         if (!LoadScene(mFilename)) 
    251         { 
    252         LogManager::getSingleton().logMessage("error loading scene"); 
    253         } 
    254          
    255250        // set camera position accordingly 
    256251        mCamNode->setPosition(mInitialPosition); 
     252        */ 
    257253} 
    258254//----------------------------------------------------------------------- 
     
    286282        *       because then the camera is displayed correctly in the visualization 
    287283        */ 
     284        //Vector3 viewPoint(707, 5000, 528); 
     285        Vector3 viewPoint(830, 300, -540); 
     286        std::stringstream d; d << "here3: " << viewPoint; 
     287        Ogre::LogManager::getSingleton().logMessage(d.str()); 
    288288        mCamNode = mSceneMgr->getRootSceneNode()-> 
    289                 createChildSceneNode("CamNode1", Vector3(707, 5000, 528)); 
     289                createChildSceneNode("CamNode1", viewPoint); 
    290290         
    291291        mCamNode->setOrientation(Quaternion(-0.3486, 0.0122, 0.9365, 0.0329)); 
     
    457457        loadConfig("terrainCulling.cfg"); 
    458458         
     459        if (!LoadScene(mFilename)) 
     460                LogManager::getSingleton().logMessage("error loading scene"); 
     461         
     462         
    459463        ///////////////////////////////////// 
    460464 
     
    481485        mSunLight->setSpecularColour(1, 1, 1); 
    482486 
    483         // -- Fog 
     487        //-- Fog 
     488 
    484489        // NB it's VERY important to set this before calling setWorldGeometry  
    485490        // because the vertex program picked will be different 
     
    492497         
    493498        // terrain creation 
    494         if (msShowHillyTerrain) 
    495         { 
    496                 std::string terrain_cfg("terrain.cfg"); 
    497 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 
    498                 terrain_cfg = mResourcePath + terrain_cfg; 
    499 #endif 
     499        if (1)//||msShowHillyTerrain) 
     500        { 
     501        mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain);  
     502                std::string terrain_cfg("terrainCulling.cfg"); 
    500503                mSceneMgr->setWorldGeometry(terrain_cfg); 
     504 
    501505        } 
    502506         
     
    555559void  TestCullingTerrainApplication::generateScene(int num, int objectType) 
    556560{ 
    557         float val = TerrainFrameListener::msObjectScales[objectType]; 
     561        const float val = TerrainFrameListener::msObjectScales[objectType]; 
    558562        Vector3 scale(val, val, val);  
    559563        const float maxHeight = 75; 
     
    564568        mTerrainContentGenerator->SetMaxPos(Vector3(mTerrainMaxPos.x, maxHeight, mTerrainMaxPos.z)); 
    565569         
    566         //std::stringstream d; d << "objscale: " << scale[0]; 
    567         //Ogre::LogManager::getSingleton().logMessage(d.str()); 
    568          
    569570        mTerrainContentGenerator->SetScale(scale); 
    570571        mTerrainContentGenerator->SetOffset(TerrainFrameListener::msObjectTerrainOffsets[objectType]); 
     
    576577        EntityList *entList = mTerrainContentGenerator->GetGeneratedEntities(); 
    577578 
     579        ///////////// 
    578580        //-- add animation state for new robots (located at the end of the list) 
     581         
    579582        for (int i = (int)entList->size() - num; i < (int)entList->size(); ++i) 
    580583        { 
     
    800803bool TestCullingTerrainApplication::LoadViewCells(const String &filename) 
    801804{ 
    802         LogManager::getSingleton().logMessage("loading view cells"); 
    803  
    804         //-- the actual loading happens here 
    805         return mSceneMgr->setOption("LoadViewCells", filename.c_str()); 
     805        // if not already loaded,  
     806        // the scene manager will load the view cells 
     807        return mSceneMgr->setOption("UseViewCells", filename.c_str()); 
    806808} 
    807809 
Note: See TracChangeset for help on using the changeset viewer.