Changeset 140 for trunk/VUT/Ogre/src
- Timestamp:
- 06/20/05 18:57:50 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.