Changeset 316 for trunk/VUT/Ogre
- Timestamp:
- 10/10/05 15:23:32 (19 years ago)
- Location:
- trunk/VUT/Ogre
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgreOcclusionQueriesQueryManager.h
r174 r316 19 19 20 20 void ComputeCameraVisibility(const Camera &camera, 21 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,22 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,23 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,21 GtpVisibility::NodeInfoContainer *visibleNodes, 22 GtpVisibility::MeshInfoContainer *visibleGeometry, 23 GtpVisibility::PatchInfoContainer *visiblePatches, 24 24 bool relativeVisibility = false); 25 25 … … 29 29 */ 30 30 void ComputeFromPointVisibility(const Vector3 &point, 31 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,32 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,33 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,31 GtpVisibility::NodeInfoContainer *visibleNodes, 32 GtpVisibility::MeshInfoContainer *visibleGeometry, 33 GtpVisibility::PatchInfoContainer *visiblePatches, 34 34 bool relativeVisibility = false); 35 35 … … 40 40 GtpVisibility::QueryList::iterator &projQueryIt, 41 41 GtpVisibility::GeometryList *geometryList, 42 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,42 GtpVisibility::MeshInfoContainer *visibleGeometry, 43 43 bool relativeVisibility); 44 44 … … 46 46 GtpVisibility::QueryList::iterator &projQueryIt, 47 47 GtpVisibility::HierarchyNodeList *nodeList, 48 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,48 GtpVisibility::NodeInfoContainer *visibleNodes, 49 49 bool relativeVisibility); 50 50 51 51 void CollectRelativeGeometryVisibilityForItemBuffer(GtpVisibility::QueryList::iterator &projQueryIt, 52 52 GtpVisibility::GeometryList *geometryList, 53 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry);53 GtpVisibility::MeshInfoContainer *visibleGeometry); 54 54 55 55 void CollectRelativePatchVisibilityForItemBuffer( 56 56 GtpVisibility::QueryList::iterator &projQueryIt, 57 57 GtpVisibility::PatchList *patchList, 58 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches);58 GtpVisibility::PatchInfoContainer *visiblePatches); 59 59 60 60 void CollectPatchVisibility(GtpVisibility::QueryList::iterator &visQueryIt, 61 61 GtpVisibility::QueryList::iterator &projQueryIt, 62 62 GtpVisibility::PatchList *patchList, 63 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,63 GtpVisibility::PatchInfoContainer *visiblePatches, 64 64 bool relativeVisibility); 65 65 66 void RemoveDuplicateNodes( InfoContainer<GtpVisibility::NodeInfo>*visibleNodes);67 void RemoveDuplicateGeometry( InfoContainer<GtpVisibility::MeshInfo>*visibleMesh);68 void RemoveDuplicatePatches( InfoContainer<GtpVisibility::PatchInfo>*visiblePatches);66 void RemoveDuplicateNodes(GtpVisibility::NodeInfoContainer *visibleNodes); 67 void RemoveDuplicateGeometry(GtpVisibility::MeshInfoContainer *visibleMesh); 68 void RemoveDuplicatePatches(GtpVisibility::PatchInfoContainer *visiblePatches); 69 69 70 70 /** Returns the patches of the geometry of a given node. -
trunk/VUT/Ogre/include/OgrePlatformQueryManager.h
r174 r316 25 25 */ 26 26 void ComputeFromPointVisibility(const Vector3 &point, 27 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,28 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,29 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,27 GtpVisibility::NodeInfoContainer *visibleNodes, 28 GtpVisibility::MeshInfoContainer *visibleGeometry, 29 GtpVisibility::PatchInfoContainer *visiblePatches, 30 30 bool relativeVisibility = false); 31 31 32 32 void ComputeCameraVisibility(const Camera &camera, 33 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,34 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,35 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,33 GtpVisibility::NodeInfoContainer *visibleNodes, 34 GtpVisibility::MeshInfoContainer *visibleGeometry, 35 GtpVisibility::PatchInfoContainer *visiblePatches, 36 36 bool relativeVisibility = false); 37 37 … … 45 45 46 46 void CollectItemBufferResults( 47 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,48 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches);47 GtpVisibility::MeshInfoContainer *visibleGeometry, 48 GtpVisibility::PatchInfoContainer *visiblePatches); 49 49 50 void InitItemBuffer( InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,51 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches);50 void InitItemBuffer(GtpVisibility::MeshInfoContainer *visibleGeometry, 51 GtpVisibility::PatchInfoContainer *visiblePatches); 52 52 53 53 Viewport *mViewport; -
trunk/VUT/Ogre/scripts/Plugin_VisibilitySceneManager.vcproj
r171 r316 150 150 Filter=""> 151 151 <File 152 RelativePath="..\include\OgreBspHierarchyInterface.h">153 </File>154 <File155 152 RelativePath="..\include\OgreOctreeHierarchyInterface.h"> 156 153 </File> … … 191 188 Name="Header Files" 192 189 Filter="h;hpp;hxx;hm;inl;inc"> 190 <File 191 RelativePath="..\include\OgreBspHierarchyInterface.h"> 192 </File> 193 193 <File 194 194 RelativePath="..\include\OgreOcclusionQueriesQueryManager.h"> -
trunk/VUT/Ogre/src/OgreOcclusionQueriesQueryManager.cpp
r175 r316 8 8 namespace Ogre { 9 9 10 /** 11 These functions necessary to enable sorting of node / mesh / patch info. 12 */ 13 //----------------------------------------------------------------------- 14 inline bool nodeinfo_eq(const GtpVisibility::NodeInfo &info1, const GtpVisibility::NodeInfo &info2) 15 { 16 return info1.GetNode() == info2.GetNode(); 17 } 18 //----------------------------------------------------------------------- 19 inline bool meshinfo_eq(const GtpVisibility::MeshInfo &info1, const GtpVisibility::MeshInfo &info2) 20 { 21 return info1.GetMesh() == info2.GetMesh(); 22 } 23 //----------------------------------------------------------------------- 24 inline bool patchinfo_eq(const GtpVisibility::PatchInfo &info1, const GtpVisibility::PatchInfo &info2) 25 { 26 return info1.GetPatch() == info2.GetPatch(); 27 } 28 //----------------------------------------------------------------------- 29 inline bool nodeinfo_lower(const GtpVisibility::NodeInfo &info1, const GtpVisibility::NodeInfo &info2) 30 { 31 return info1.GetNode() < info2.GetNode(); 32 } 33 //----------------------------------------------------------------------- 34 inline bool meshinfo_lower(const GtpVisibility::MeshInfo &info1, const GtpVisibility::MeshInfo &info2) 35 { 36 return info1.GetMesh() < info2.GetMesh(); 37 } 38 //----------------------------------------------------------------------- 39 inline bool patchinfo_lower(const GtpVisibility::PatchInfo &info1, const GtpVisibility::PatchInfo &info2) 40 { 41 return info1.GetPatch() < info2.GetPatch(); 42 } 43 10 //----------------------------------------------------------------------- 11 bool nodeinfo_eq(const GtpVisibility::NodeInfo &a, const GtpVisibility::NodeInfo &b) 12 { 13 return a.GetSource() == b.GetSource(); 14 } 15 bool nodeinfo_lt(const GtpVisibility::NodeInfo &a, const GtpVisibility::NodeInfo &b) 16 { 17 return a.GetSource() < b.GetSource(); 18 } 19 bool meshinfo_eq(const GtpVisibility::MeshInfo &a, const GtpVisibility::MeshInfo &b) 20 { 21 return a.GetSource() == b.GetSource(); 22 } 23 bool meshinfo_lt(const GtpVisibility::MeshInfo &a, const GtpVisibility::MeshInfo &b) 24 { 25 return a.GetSource() < b.GetSource(); 26 } 27 bool patchinfo_eq(const GtpVisibility::PatchInfo &a, const GtpVisibility::PatchInfo &b) 28 { 29 return a.GetSource() == b.GetSource(); 30 } 31 bool patchinfo_lt(const GtpVisibility::PatchInfo &a, const GtpVisibility::PatchInfo &b) 32 { 33 return a.GetSource() < b.GetSource(); 34 } 44 35 45 36 //----------------------------------------------------------------------- … … 55 46 //----------------------------------------------------------------------- 56 47 void OcclusionQueriesQueryManager::ComputeCameraVisibility(const Camera &camera, 57 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,58 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,59 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,48 GtpVisibility::NodeInfoContainer *visibleNodes, 49 GtpVisibility::MeshInfoContainer *visibleGeometry, 50 GtpVisibility::PatchInfoContainer *visiblePatches, 60 51 bool relativeVisibility) 61 52 { … … 238 229 //----------------------------------------------------------------------- 239 230 void OcclusionQueriesQueryManager::ComputeFromPointVisibility(const Vector3 &point, 240 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,241 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,242 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,231 GtpVisibility::NodeInfoContainer *visibleNodes, 232 GtpVisibility::MeshInfoContainer *visibleGeometry, 233 GtpVisibility::PatchInfoContainer *visiblePatches, 243 234 bool relativeVisibility) 244 235 { … … 265 256 GtpVisibility::QueryList::iterator &projQueryIt, 266 257 GtpVisibility::HierarchyNodeList *nodeList, 267 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,258 GtpVisibility::NodeInfoContainer *visibleNodes, 268 259 bool relativeVisibility) 269 260 { … … 299 290 GtpVisibility::QueryList::iterator &projQueryIt, 300 291 GtpVisibility::GeometryList *geometryList, 301 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry)292 GtpVisibility::MeshInfoContainer *visibleGeometry) 302 293 { 303 294 GtpVisibility::GeometryList::iterator geometryIt; … … 323 314 GtpVisibility::QueryList::iterator &projQueryIt, 324 315 GtpVisibility::PatchList *patchList, 325 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches)316 GtpVisibility::PatchInfoContainer *visiblePatches) 326 317 { 327 318 GtpVisibility::PatchList::iterator patchIt; … … 348 339 GtpVisibility::QueryList::iterator &projQueryIt, 349 340 GtpVisibility::GeometryList *geometryList, 350 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,341 GtpVisibility::MeshInfoContainer *visibleGeometry, 351 342 bool relativeVisibility) 352 343 { … … 383 374 GtpVisibility::QueryList::iterator &projQueryIt, 384 375 GtpVisibility::PatchList *patchList, 385 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,376 GtpVisibility::PatchInfoContainer *visiblePatches, 386 377 bool relativeVisibility) 387 378 { … … 415 406 //----------------------------------------------------------------------- 416 407 void OcclusionQueriesQueryManager::RemoveDuplicateNodes( 417 InfoContainer<GtpVisibility::NodeInfo> *visibleNodes) 418 { 419 sort(visibleNodes->begin(), visibleNodes->end(), nodeinfo_lower); 420 InfoContainer<GtpVisibility::NodeInfo>::iterator visibleNodesIt, 408 GtpVisibility::NodeInfoContainer *visibleNodes) 409 { 410 sort(visibleNodes->begin(), visibleNodes->end(), nodeinfo_lt); 411 412 GtpVisibility::NodeInfoContainer::iterator visibleNodesIt, 421 413 visibleNodesIt_end = visibleNodes->end(); 422 414 … … 426 418 ++visibleNodesIt) 427 419 { 428 if (!nodeInfo || (nodeInfo->Get Node() != (*visibleNodesIt).GetNode()))420 if (!nodeInfo || (nodeInfo->GetSource() != (*visibleNodesIt).GetSource())) 429 421 { 430 422 nodeInfo = &(*visibleNodesIt); … … 437 429 438 430 // physically delete duplicates 439 visibleNodes->erase( std::unique(visibleNodes->begin(),440 visibleNodes->end(), nodeinfo_eq),visibleNodes->end());431 visibleNodes->erase(std::unique(visibleNodes->begin(), visibleNodes->end(), nodeinfo_eq), 432 visibleNodes->end()); 441 433 } 442 434 //----------------------------------------------------------------------- 443 435 void OcclusionQueriesQueryManager::RemoveDuplicateGeometry( 444 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry)445 { 446 sort(visibleGeometry->begin(), visibleGeometry->end(), meshinfo_l ower);447 448 InfoContainer<GtpVisibility::MeshInfo>::iterator visibleGeomIt,436 GtpVisibility::MeshInfoContainer *visibleGeometry) 437 { 438 sort(visibleGeometry->begin(), visibleGeometry->end(), meshinfo_lt); 439 440 GtpVisibility::MeshInfoContainer::iterator visibleGeomIt, 449 441 visibleGeomIt_end = visibleGeometry->end(); 450 442 … … 454 446 ++visibleGeomIt) 455 447 { 456 if (!geomInfo || (geomInfo->Get Mesh() != (*visibleGeomIt).GetMesh()))448 if (!geomInfo || (geomInfo->GetSource() != (*visibleGeomIt).GetSource())) 457 449 { 458 450 geomInfo = &(*visibleGeomIt); … … 465 457 466 458 // physically delete duplicates 467 visibleGeometry->erase(std::unique(visibleGeometry->begin(), visibleGeometry->end(), 468 meshinfo_eq),visibleGeometry->end());459 visibleGeometry->erase(std::unique(visibleGeometry->begin(), visibleGeometry->end(), meshinfo_eq), 460 visibleGeometry->end()); 469 461 } 470 462 //----------------------------------------------------------------------- 471 463 void OcclusionQueriesQueryManager::RemoveDuplicatePatches( 472 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches)473 { 474 sort(visiblePatches->begin(), visiblePatches->end(), patchinfo_l ower);475 476 InfoContainer<GtpVisibility::PatchInfo>::iterator visiblePatchIt,464 GtpVisibility::PatchInfoContainer *visiblePatches) 465 { 466 sort(visiblePatches->begin(), visiblePatches->end(), patchinfo_lt); 467 468 GtpVisibility::PatchInfoContainer::iterator visiblePatchIt, 477 469 visiblePatchIt_end = visiblePatches->end(); 478 470 … … 482 474 ++visiblePatchIt) 483 475 { 484 if (!patchInfo || (patchInfo->Get Patch() != (*visiblePatchIt).GetPatch()))476 if (!patchInfo || (patchInfo->GetSource() != (*visiblePatchIt).GetSource())) 485 477 { 486 478 patchInfo = &(*visiblePatchIt); … … 493 485 494 486 // physically delete duplicates 495 visiblePatches->erase(std::unique(visiblePatches->begin(), visiblePatches->end(), 496 patchinfo_eq),visiblePatches->end());487 visiblePatches->erase(std::unique(visiblePatches->begin(), visiblePatches->end(), patchinfo_eq), 488 visiblePatches->end()); 497 489 } 498 490 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r187 r316 87 87 88 88 mRenderSystem->_setWorldMatrix(Ogre::Matrix4::IDENTITY); 89 mSceneManager->useRenderableViewProjMode (solidBox);89 mSceneManager->useRenderableViewProjModeWrapper(solidBox); 90 90 91 91 // set no depth write, no color, no lighting material 92 mSceneManager->setPass (solidBox->getTechnique()->getPass(0));92 mSceneManager->setPassWrapper(solidBox->getTechnique()->getPass(0)); // HACK! (mySetPass should be setPass) 93 93 //SetOcclusionPass(); 94 94 -
trunk/VUT/Ogre/src/OgrePlatformQueryManager.cpp
r174 r316 26 26 //----------------------------------------------------------------------- 27 27 void PlatformQueryManager::ComputeFromPointVisibility(const Vector3 &point, 28 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,29 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,30 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,28 GtpVisibility::NodeInfoContainer *visibleNodes, 29 GtpVisibility::MeshInfoContainer *visibleGeometry, 30 GtpVisibility::PatchInfoContainer *visiblePatches, 31 31 bool relativeVisibility) 32 32 { … … 86 86 //----------------------------------------------------------------------- 87 87 void PlatformQueryManager::ComputeCameraVisibility(const Camera &camera, 88 InfoContainer<GtpVisibility::NodeInfo>*visibleNodes,89 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,90 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,88 GtpVisibility::NodeInfoContainer *visibleNodes, 89 GtpVisibility::MeshInfoContainer *visibleGeometry, 90 GtpVisibility::PatchInfoContainer *visiblePatches, 91 91 bool relativeVisibility) 92 92 { … … 137 137 //----------------------------------------------------------------------- 138 138 void PlatformQueryManager::CollectItemBufferResults( 139 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,140 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches)139 GtpVisibility::MeshInfoContainer *visibleGeometry, 140 GtpVisibility::PatchInfoContainer *visiblePatches) 141 141 { 142 142 int dimx = 0; … … 180 180 //----------------------------------------------------------------------- 181 181 void PlatformQueryManager::InitItemBuffer( 182 InfoContainer<GtpVisibility::MeshInfo>*visibleGeometry,183 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches)182 GtpVisibility::MeshInfoContainer *visibleGeometry, 183 GtpVisibility::PatchInfoContainer *visiblePatches) 184 184 { 185 185 if (mWasInitialised)
Note: See TracChangeset
for help on using the changeset viewer.