Changeset 140
- Timestamp:
- 06/20/05 18:57:50 (20 years ago)
- Location:
- trunk/VUT
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgrePlatformQueryManager.h
r133 r140 78 78 79 79 protected: 80 SceneManager *mSceneManager;81 80 Viewport *mViewport; 82 81 }; -
trunk/VUT/Ogre/src/OgrePlatformQueryManager.cpp
r136 r140 3 3 #include <OgreSceneManager.h> 4 4 #include <OgreLogManager.h> 5 5 #include <OgreStringConverter.h> 6 6 #include <vector> 7 7 … … 176 176 bool relativeVisibility) 177 177 { 178 178 SceneManager *sm = dynamic_cast<PlatformHierarchyInterface *>(mHierarchyInterface)->GetSceneManager(); 179 Camera *cam = sm->createCamera("PointQueryCam"); 180 181 Camera *oldCam = mViewport->getCamera(); 182 mViewport->setCamera(cam); 183 184 cam->setPosition(point); 185 186 // set frustum to 45 degrees so all the scene can be captured with 6 shots 187 //cam->setAspectRatio(1.0); 188 //cam->setFOVy(Radian(Math::HALF_PI)); 189 190 std::stringstream d; 191 d << "old camera: " + StringConverter::toString(oldCam->getDerivedPosition()) + 192 " " + "O: " + StringConverter::toString(oldCam->getDerivedOrientation()); 193 LogManager::getSingleton().logMessage(d.str()); 194 195 int sign = -1; 196 197 // ---- capture visibility from all 6 directions 198 for (int i=0; i < 6; i++) 199 { 200 sign *= -1; 201 202 // Print camera details 203 //mViewport->getTarget()->setDebugText("P: " + StringConverter::toString(cam->getDerivedPosition()) + 204 // " " + "O: " + StringConverter::toString(cam->getDerivedOrientation())); 205 206 std::stringstream d; 207 d << "Point query camera: " + StringConverter::toString(cam->getDerivedPosition()) + 208 " " + "O: " + StringConverter::toString(cam->getDerivedOrientation()); 209 LogManager::getSingleton().logMessage(d.str()); 210 211 ComputeCameraVisibility(*cam, visibleNodes, visibleGeometry, relativeVisibility); 212 213 mViewport->getTarget()->update(); 214 215 Vector3 dir(0,0,0); 216 dir[i/2] = sign; 217 218 cam->setDirection(dir); 219 220 for(int j=0; j<10000000; j++) printf("HAAHHAHAHAHAH"); 221 222 // four shots around y axis, two around x axis 223 //Vector3 axis = i < 4 ? Vector3::UNIT_Y : Vector3::UNIT_X; 224 //Radian angle = i < 5 ? 225 //cam->rotate(axis, Radian(Math::HALF_PI)); 226 } 227 228 229 // reset camera 230 mViewport->setCamera(oldCam); 179 231 } 180 232 //----------------------------------------------------------------------- -
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
r139 r140 360 360 if (fromPoint) 361 361 { 362 Vector3 point;363 362 mVisibilityManager->GetQueryManager()-> 364 ComputeFromPointVisibility(point, &visibleNodes, &visibleGeometry, relativeVisibility); 363 ComputeFromPointVisibility(mCamNode->getPosition(), &visibleNodes, 364 &visibleGeometry, relativeVisibility); 365 365 } 366 366 else … … 430 430 void TerrainFrameListener::Clamp2Terrain() 431 431 { 432 // clamp to terrain432 // clamp camera to terrain 433 433 Vector3 camPos = mCamNode->getPosition(); 434 434 Vector3 queryResult; … … 437 437 Vector3(camPos.x, 5000.0f, camPos.z), Vector3::NEGATIVE_UNIT_Y)) 438 438 { 439 mCamNode->setPosition(camPos.x, queryResult.y + 10, camPos.z); 439 const int overTerrain = 200; 440 mCamNode->setPosition(camPos.x, queryResult.y + overTerrain, camPos.z); 440 441 } 441 442 } … … 494 495 mFrameInfo.push_back(info); 495 496 496 /* std::stringstream d; 497 d << StringConverter::toString(info.position) << " " << StringConverter::toString(info.orientation); 498 LogManager::getSingleton().logMessage(d.str()); */ 497 // std::stringstream d; d << StringConverter::toString(info.position) << " " << StringConverter::toString(info.orientation); 498 // LogManager::getSingleton().logMessage(d.str()); 499 499 } 500 500 ifstr.close();
Note: See TracChangeset
for help on using the changeset viewer.