Ignore:
Timestamp:
12/05/05 04:42:54 (19 years ago)
Author:
mattausch
Message:

fixed bug in VspBspTree?
view cells in VssPreprocessor?
bounding rays for vspkdtree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp

    r447 r448  
    99#include "VssRay.h" 
    1010#include "RssTree.h" 
    11  
     11#include "ViewCellBsp.h" 
    1212 
    1313static bool useViewSpaceBox = true;//true; 
     
    474474  } 
    475475   
    476   //-- construct BSP view cells 
    477   if (ViewCell::sHierarchy == ViewCell::BSP)  
    478   { 
    479         const int bspSamples = min((int)mVssRays.size(), mBspConstructionSamples); 
    480          
    481         Debug << "bpssamples: " << bspSamples << endl; 
    482         for (int i = 0; i < bspSamples; ++ i) 
    483           bspRays.push_back(new Ray(*mVssRays[i])); 
    484          
    485         //-- construct BSP tree using the samples 
    486         mBspTree = new BspTree(&mUnbounded);     
    487          
    488         ObjectContainer objects; 
    489         mSceneGraph->CollectObjects(&objects); 
    490         mBspTree->Construct(objects, bspRays); 
    491   } 
    492    
    493476  rssTree = new RssTree; 
    494477  // viewcells = Construct(mVssRays); 
     
    567550        } 
    568551 
    569         // cast rays into BSP tree 
    570         if (ViewCell::sHierarchy == ViewCell::BSP)  
    571           { 
    572                 for (int i = 0; i < (int)vssRays.size(); ++ i) 
    573                   { 
    574                         CastRay(*mBspTree, *vssRays[i]); 
    575                   } 
    576           } 
    577  
    578552        samples+=num; 
    579553        float pvs = rssTree->GetAvgPvsSize(); 
     
    598572  delete rssTree; 
    599573   
    600   if (ViewCell::sHierarchy == ViewCell::BSP)  
    601         { 
    602           Debug << mBspTree->GetStatistics(); 
    603  
    604           ObjectContainer objects; 
    605           ExportSplits(objects, bspRays, 10000); 
    606           ExportBspPvs(objects, bspRays, 10000); 
    607  
    608           BspViewCellsStatistics stat; 
    609           mBspTree->EvaluateViewCellsStats(stat); 
    610           Debug << "original view cell partition:\n" << stat << endl; 
    611  
    612           // clear BSP samples 
    613           CLEAR_CONTAINER(bspRays); 
    614         } 
    615574 
    616575  return true; 
     
    646605          BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 
    647606          // if ray not in unbounded space 
    648           if (leaf->GetViewCell() != &mUnbounded) 
     607/*        if (leaf->GetViewCell() != &mUnbounded) 
    649608                contributingSamples +=  
    650                   leaf->GetViewCell()->GetPvs().AddSample(obj); 
     609                  leaf->GetViewCell()->GetPvs().AddSample(obj);*/ 
    651610        } 
    652611  
     
    657616                BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 
    658617                 
    659                 if (leaf->GetViewCell() != &mUnbounded) 
     618        /*      if (leaf->GetViewCell() != &mUnbounded) 
    660619                  leaf->GetViewCell()-> 
    661                         AddPassingRay(ray, contributingSamples ? 1 : 0); 
     620                        AddPassingRay(ray, contributingSamples ? 1 : 0);*/ 
    662621          } 
    663622   
Note: See TracChangeset for help on using the changeset viewer.