Changeset 1941


Ignore:
Timestamp:
01/05/07 16:06:23 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp

    r1934 r1941  
    15531553        } 
    15541554 
    1555         // only use a subset of the rays for visibility based heuristics 
    1556         if (mUseCostHeuristics && useVisibilityBasedHeuristics) 
     1555        // if #rays high consider only use a subset of the rays for  
     1556        // visibility based heuristics 
     1557        VssRay::NewMail(); 
     1558 
     1559        if ((mMaxTests < tData.mNumRays) &&      mUseCostHeuristics && useVisibilityBasedHeuristics) 
    15571560        { 
    15581561                VssRayContainer rays; 
     1562 
    15591563                // maximal 2 objects share the same ray 
    15601564                rays.reserve(tData.mNumRays * 2); 
    15611565                CollectRays(tData.mNode->mObjects, rays); 
    15621566 
    1563                 const float prop = (float)mMaxTests / (float)tData.mNumRays; 
    1564  
    1565                 VssRay::NewMail(); 
     1567                const float prop = (float)mMaxTests / (float)rays.size(); 
    15661568 
    15671569                VssRayContainer::const_iterator rit, rit_end = rays.end(); 
    15681570 
    1569                 int nRays = 0; 
    1570  
     1571                // mail rays which will not be considered 
    15711572                for (rit = rays.begin(); rit != rit_end; ++ rit) 
    15721573                { 
    1573                         if ((mMaxTests >= (int)rays.size()) || (Random(1.0f) < prop)) 
     1574                        if (Random(1.0f) > prop) 
    15741575                        { 
    15751576                                (*rit)->Mail(); 
    1576                                 ++ nRays; 
    15771577                        } 
    1578                 } 
     1578                }                
    15791579        } 
    15801580 
     
    18391839                                                                  ViewCellContainer &viewCells, 
    18401840                                                                  const bool setCounter, 
    1841                                                                   const bool onlyMailedRays) const 
     1841                                                                  const bool onlyUnmailedRays) const 
    18421842{ 
    18431843        ViewCell::NewMail(); 
     
    18491849        { 
    18501850                // always use only mailed objects 
    1851                 numRays += CollectViewCells(*oit, viewCells, true, setCounter, onlyMailedRays); 
     1851                numRays += CollectViewCells(*oit, viewCells, true, setCounter, onlyUnmailedRays); 
    18521852        } 
    18531853 
     
    18601860                                                                  const bool useMailBoxing, 
    18611861                                                                  const bool setCounter, 
    1862                                                                   const bool onlyMailedRays) const 
     1862                                                                  const bool onlyUnmailedRays) const 
    18631863{ 
    18641864        VssRayContainer::const_iterator rit, rit_end = obj->GetOrCreateRays()->end(); 
     
    18701870                VssRay *ray = (*rit); 
    18711871 
    1872                 if (onlyMailedRays && !ray->Mailed()) 
     1872                if (onlyUnmailedRays && ray->Mailed()) 
    18731873                { 
    18741874                        continue; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h

    r1933 r1941  
    822822                                                 ViewCellContainer &viewCells, 
    823823                                                 const bool setCounter, 
    824                                                  const bool onlyMailedRays) const; 
     824                                                 const bool onlyUnmailedRays) const; 
    825825 
    826826        /** Collects view cells which see an object. 
     
    828828                only unmailed object should pass 
    829829                @param setCounter counter for the sweep algorithm 
    830                 @param onlyMailedRays if only mailed rays should be considered 
     830                @param onlyUnmailedRays if only unmailed rays should be considered 
    831831        */ 
    832832        int CollectViewCells(Intersectable *object,  
     
    834834                                                 const bool useMailBoxing, 
    835835                                                 const bool setCounter, 
    836                                                  const bool onlyMailedRays) const; 
     836                                                 const bool onlyUnmailedRays) const; 
    837837 
    838838        /** Counts the view cells of this object. note: only 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r1935 r1941  
    125125  if (mUseFalseColors) 
    126126        SetupFalseColor(object->mId); 
    127    
     127  glColor3f(1, 1,1); 
    128128 
    129129  switch (object->Type()) { 
Note: See TracChangeset for help on using the changeset viewer.