Ignore:
Timestamp:
11/17/05 18:47:53 (19 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r419 r420  
    6161        ObjectContainer objects; 
    6262         
    63         switch (BspTree::sConstructionMethod) 
     63        switch (mBspTree->mConstructionMethod) 
    6464        { 
    6565        case BspTree::FROM_INPUT_VIEW_CELLS: 
     
    181181        } 
    182182 
    183         if (ViewCell::sHierarchy == ViewCell::BSP) 
     183        switch(ViewCell::sHierarchy) 
    184184        { 
    185                 // cast ray to BSP tree to get intersection with view cells 
    186                 if (mBspTree) 
    187                 { 
    188                         mBspTree->CastRay(ray); 
    189                          
    190                         if (object) 
    191                                 sampleContributions += AddObjectSamples(object, ray); 
    192                          
    193                         if (!ray.intersections.empty()) // second intersection found 
    194                         { 
    195                                 sampleContributions +=  
    196                                         AddObjectSamples(ray.intersections[0].mObject, ray); 
    197                         } 
    198                 } 
    199         } 
    200         else { 
    201                 if (ray.kdLeaves.size()) { 
     185        case ViewCell::BSP: 
     186                 
     187                //-- cast ray to BSP tree to get intersection with view cells 
     188                if (!mBspTree) 
     189                        break; 
     190                 
     191                mBspTree->CastRay(ray); 
     192                         
     193                if (object) 
     194                        sampleContributions += AddObjectSamples(object, ray); 
     195                         
     196                if (!ray.intersections.empty()) // second intersection found 
     197                { 
     198                        sampleContributions +=  
     199                                AddObjectSamples(ray.intersections[0].mObject, ray); 
     200                } 
     201                break; 
     202        case ViewCell::KD: 
     203                if (ray.kdLeaves.size())  
     204                { 
    202205                        Intersectable *terminator = 
    203206                                ray.intersections.size() ? ray.intersections[0].mObject: NULL; 
    204207 
    205208                        sampleContributions += AddNodeSamples(ray, 
    206                                                                                                                                                                                 object, 
    207                                                                                                                                                                                 terminator); 
    208                 } 
    209         } 
    210          
     209                                                                                                                                                                        object, 
     210                                                                                                                                                                        terminator); 
     211                } 
     212                break; 
     213        case ViewCell::VSP: 
     214                // TODO: 
     215                break; 
     216        default: 
     217                Debug << "Should never come here" << endl; 
     218                break; 
     219        } 
     220 
    211221        return sampleContributions; 
    212222} 
     
    573583                        if (exporter) 
    574584                        { 
     585                                exporter->SetWireframe(); 
    575586                                exporter->ExportBspLeaves(*mBspTree, stat.maxPvs); 
    576587                                //exporter->ExportBspViewCellPartition(*mBspTree, 0); 
     588                                 
     589                                if (1) // export scene geometry 
     590                                { 
     591                                        Material m;//= RandomMaterial(); 
     592                                        m.mDiffuseColor = RgbColor(0, 1, 0); 
     593                                        exporter->SetForcedMaterial(m); 
     594                                        exporter->SetWireframe(); 
     595         
     596                                        for (int j = 0; j < objects.size(); ++ j) 
     597                                                exporter->ExportIntersectable(objects[j]); 
     598                                } 
     599                                         
    577600                                delete exporter; 
    578601                        } 
     
    756779        if (!mBspTree) 
    757780        { 
    758                 if ((BspTree::sConstructionMethod == BspTree::FROM_RAYS) && 
     781                if ((BspTree::mConstructionMethod == BspTree::FROM_RAYS) && 
    759782                        ((int)mSampleRays.size() < mBspConstructionSamples)) 
    760783                { 
     
    866889                                        outRays.push_back(mSampleRays[i]); 
    867890                        } 
    868                         if (BspTree::sConstructionMethod == BspTree::FROM_RAYS) 
     891                        if (BspTree::mConstructionMethod == BspTree::FROM_RAYS) 
    869892                        { 
    870893                                // export rays  
Note: See TracChangeset for help on using the changeset viewer.