Changeset 141 for trunk/VUT/Ogre/src
- Timestamp:
- 06/21/05 11:18:09 (20 years ago)
- Location:
- trunk/VUT/Ogre/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgrePlatformQueryManager.cpp
r140 r141 105 105 //---- collect results 106 106 unsigned int visiblePixels = 0; 107 std::pair<InfoContainer<GtpVisibility::NodeInfo>::iterator, bool> insertNode; 108 std::pair<InfoContainer<GtpVisibility::MeshInfo>::iterator, bool> insertGeom; 107 109 108 110 GtpVisibility::QueryList::iterator visQueryIt, projQueryIt; … … 116 118 (*visQueryIt)->GetQueryResult(visiblePixels, true); 117 119 118 119 120 float vis = (float)visiblePixels; 121 bool isVisible = visiblePixels > 0; 120 122 121 123 if (relativeVisibility) … … 132 134 ++visQueryIt; 133 135 134 // leavenodes with visibilty 0 in queue:136 // nodes with visibilty 0 in queue: 135 137 // happens if node is intersected by near plane 136 visibleNodes->push_back(GtpVisibility::NodeInfo(*nodeIt, vis)); 138 if (isVisible) 139 { 140 insertNode = visibleNodes->insert(GtpVisibility::NodeInfo(*nodeIt, vis)); 141 142 if (!insertNode.second) // element already in list 143 { 144 //LogManager::getSingleton().logMessage("element already in list"); 145 (*insertNode.first).SetVisibility((*insertNode.first).GetVisibility() + vis); 146 147 if (relativeVisibility) // relative visibility between zero and one 148 { 149 (*insertNode.first).SetVisibility((*insertNode.first).GetVisibility() * 0.5); 150 } 151 } 152 } 137 153 } 138 154 … … 164 180 // geometry maybe occluded 165 181 if (isVisible) 166 { 167 visibleGeometry->push_back(GtpVisibility::MeshInfo(*geometryIt, vis)); 182 { 183 insertGeom = visibleGeometry->insert(GtpVisibility::MeshInfo(*geometryIt, vis)); 184 if (!insertGeom.second) // element already in list 185 { 186 //LogManager::getSingleton().logMessage("element already in list"); 187 (*insertGeom.first).SetVisibility((*insertGeom.first).GetVisibility() + vis); 188 189 if (relativeVisibility) // relative visibility between zero and one 190 { 191 (*insertGeom.first).SetVisibility((*insertGeom.first).GetVisibility() * 0.5); 192 } 193 } 168 194 } 169 195 } … … 179 205 Camera *cam = sm->createCamera("PointQueryCam"); 180 206 181 Camera *oldCam = mViewport->getCamera(); 207 //save old camera 208 Camera *savedCam = mViewport->getCamera(); 209 210 // --- initialise new camera 182 211 mViewport->setCamera(cam); 183 184 212 cam->setPosition(point); 185 213 214 cam->setNearClipDistance(savedCam->getNearClipDistance()); 215 cam->setFarClipDistance(savedCam->getFarClipDistance()); 216 186 217 // 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 218 cam->setAspectRatio(1.0); 219 cam->setFOVy(Radian(Math::HALF_PI)); 220 190 221 std::stringstream d; 191 d << "old camera: " + StringConverter::toString( oldCam->getDerivedPosition()) +192 " " + "O: " + StringConverter::toString( oldCam->getDerivedOrientation());222 d << "old camera: " + StringConverter::toString(savedCam->getDerivedPosition()) + 223 " " + "O: " + StringConverter::toString(savedCam->getDerivedOrientation()); 193 224 LogManager::getSingleton().logMessage(d.str()); 194 225 … … 201 232 202 233 // Print camera details 203 //mViewport->getTarget()->setDebugText("P: " + StringConverter::toString(cam->getDerivedPosition()) + 204 // " " + "O: " + StringConverter::toString(cam->getDerivedOrientation())); 205 206 std::stringstream d; 234 std::stringstream d; 207 235 d << "Point query camera: " + StringConverter::toString(cam->getDerivedPosition()) + 208 236 " " + "O: " + StringConverter::toString(cam->getDerivedOrientation()); … … 211 239 ComputeCameraVisibility(*cam, visibleNodes, visibleGeometry, relativeVisibility); 212 240 213 mViewport->getTarget()->update(); 214 241 //mViewport->getTarget()->update(); for(int j=0; j<10000000; j++) printf("HAAHHAHAHAHAH"); 242 243 // permute directions 215 244 Vector3 dir(0,0,0); 216 245 dir[i/2] = sign; 217 246 218 247 cam->setDirection(dir); 219 220 for(int j=0; j<10000000; j++) printf("HAAHHAHAHAHAH");221 222 // four shots around y axis, two around x axis223 //Vector3 axis = i < 4 ? Vector3::UNIT_Y : Vector3::UNIT_X;224 //Radian angle = i < 5 ?225 //cam->rotate(axis, Radian(Math::HALF_PI));226 248 } 227 249 228 250 229 251 // reset camera 230 mViewport->setCamera( oldCam);252 mViewport->setCamera(savedCam); 231 253 } 232 254 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r139 r141 609 609 mLeavePassesInQueue = 0; 610 610 611 /*if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE)611 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) 612 612 { 613 613 mShadowTechnique = SHADOWTYPE_NONE; … … 615 615 if (!mUseDepthPass) 616 616 { 617 // TODO: remove this 617 // TODO: remove this because should be processed in first pass 618 618 mLeavePassesInQueue |= RenderPriorityGroup::SOLID_PASSES_NOSHADOW; 619 619 … … 633 633 } 634 634 } 635 */635 636 636 if (mDelayRenderTransparents && (!mUseDepthPass)) 637 637 { 638 638 mLeavePassesInQueue |= RenderPriorityGroup::TRANSPARENT_PASSES; 639 639 } 640 std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue; 641 LogManager::getSingleton().logMessage(d.str()); 640 //std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue;LogManager::getSingleton().logMessage(d.str()); 642 641 643 642 // possible two cameras (one for culling, one for rendering)
Note: See TracChangeset
for help on using the changeset viewer.