- Timestamp:
- 02/08/07 11:42:53 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
r1816 r2101 192 192 } 193 193 194 val = config.getSetting("ViewCells");194 /* val = config.getSetting("ViewCells"); 195 195 196 196 if (!val.empty()) … … 218 218 mInitialPosition.z = atof( val.c_str()); 219 219 220 221 val = config.getSetting("OnlineCullingAlgorithm");220 */ 221 /* val = config.getSetting("OnlineCullingAlgorithm"); 222 222 223 223 if (!val.empty()) … … 248 248 // setup scene 249 249 250 if (!LoadScene(mFilename))251 {252 LogManager::getSingleton().logMessage("error loading scene");253 }254 255 250 // set camera position accordingly 256 251 mCamNode->setPosition(mInitialPosition); 252 */ 257 253 } 258 254 //----------------------------------------------------------------------- … … 286 282 * because then the camera is displayed correctly in the visualization 287 283 */ 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()); 288 288 mCamNode = mSceneMgr->getRootSceneNode()-> 289 createChildSceneNode("CamNode1", Vector3(707, 5000, 528));289 createChildSceneNode("CamNode1", viewPoint); 290 290 291 291 mCamNode->setOrientation(Quaternion(-0.3486, 0.0122, 0.9365, 0.0329)); … … 457 457 loadConfig("terrainCulling.cfg"); 458 458 459 if (!LoadScene(mFilename)) 460 LogManager::getSingleton().logMessage("error loading scene"); 461 462 459 463 ///////////////////////////////////// 460 464 … … 481 485 mSunLight->setSpecularColour(1, 1, 1); 482 486 483 // -- Fog 487 //-- Fog 488 484 489 // NB it's VERY important to set this before calling setWorldGeometry 485 490 // because the vertex program picked will be different … … 492 497 493 498 // 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"); 500 503 mSceneMgr->setWorldGeometry(terrain_cfg); 504 501 505 } 502 506 … … 555 559 void TestCullingTerrainApplication::generateScene(int num, int objectType) 556 560 { 557 float val = TerrainFrameListener::msObjectScales[objectType];561 const float val = TerrainFrameListener::msObjectScales[objectType]; 558 562 Vector3 scale(val, val, val); 559 563 const float maxHeight = 75; … … 564 568 mTerrainContentGenerator->SetMaxPos(Vector3(mTerrainMaxPos.x, maxHeight, mTerrainMaxPos.z)); 565 569 566 //std::stringstream d; d << "objscale: " << scale[0];567 //Ogre::LogManager::getSingleton().logMessage(d.str());568 569 570 mTerrainContentGenerator->SetScale(scale); 570 571 mTerrainContentGenerator->SetOffset(TerrainFrameListener::msObjectTerrainOffsets[objectType]); … … 576 577 EntityList *entList = mTerrainContentGenerator->GetGeneratedEntities(); 577 578 579 ///////////// 578 580 //-- add animation state for new robots (located at the end of the list) 581 579 582 for (int i = (int)entList->size() - num; i < (int)entList->size(); ++i) 580 583 { … … 800 803 bool TestCullingTerrainApplication::LoadViewCells(const String &filename) 801 804 { 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()); 806 808 } 807 809
Note: See TracChangeset
for help on using the changeset viewer.