Changeset 318 for trunk/VUT/Ogre


Ignore:
Timestamp:
10/11/05 19:25:27 (19 years ago)
Author:
mattausch
Message:

VisibilityInfo?: query sort operators as templates
X3dExporter: Fixed polygon wire frame, bsp splits, and bsp split planes visualization
ViewCellBsp?: Added rays to split criteria (not finished yet)
OgreOctreeSceneManager?: fixed error (mNumOctants instead of mNumOctrees)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/Ogre/src/OgreOcclusionQueriesQueryManager.cpp

    r316 r318  
    77 
    88namespace Ogre { 
    9  
    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 } 
    359 
    3610//-----------------------------------------------------------------------  
     
    408382                                        GtpVisibility::NodeInfoContainer *visibleNodes) 
    409383{ 
    410         sort(visibleNodes->begin(), visibleNodes->end(), nodeinfo_lt); 
     384        stable_sort(visibleNodes->begin(), visibleNodes->end()/*, nodeinfo_lt*/); 
    411385 
    412386        GtpVisibility::NodeInfoContainer::iterator visibleNodesIt, 
     
    429403         
    430404        // physically delete duplicates 
    431         visibleNodes->erase(std::unique(visibleNodes->begin(), visibleNodes->end(), nodeinfo_eq), 
     405        visibleNodes->erase(std::unique(visibleNodes->begin(), visibleNodes->end()), 
    432406                                                visibleNodes->end()); 
    433407} 
     
    436410                                GtpVisibility::MeshInfoContainer *visibleGeometry) 
    437411{ 
    438         sort(visibleGeometry->begin(), visibleGeometry->end(), meshinfo_lt); 
     412        stable_sort(visibleGeometry->begin(), visibleGeometry->end()); 
    439413         
    440414        GtpVisibility::MeshInfoContainer::iterator visibleGeomIt, 
     
    457431 
    458432        // physically delete duplicates 
    459         visibleGeometry->erase(std::unique(visibleGeometry->begin(), visibleGeometry->end(), meshinfo_eq),  
     433        visibleGeometry->erase(std::unique(visibleGeometry->begin(), visibleGeometry->end()),  
    460434                                                   visibleGeometry->end()); 
    461435} 
     
    464438                                GtpVisibility::PatchInfoContainer *visiblePatches) 
    465439{ 
    466         sort(visiblePatches->begin(), visiblePatches->end(), patchinfo_lt); 
     440        stable_sort(visiblePatches->begin(), visiblePatches->end()); 
    467441         
    468442        GtpVisibility::PatchInfoContainer::iterator visiblePatchIt, 
     
    485459 
    486460        // physically delete duplicates 
    487         visiblePatches->erase(std::unique(visiblePatches->begin(), visiblePatches->end(), patchinfo_eq),  
     461        visiblePatches->erase(std::unique(visiblePatches->begin(), visiblePatches->end()),  
    488462                                                  visiblePatches->end()); 
    489463} 
Note: See TracChangeset for help on using the changeset viewer.