Ignore:
Timestamp:
02/15/06 18:03:34 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r644 r645  
    963963                                                           new BoundedRayContainer(), 0, 0, new BspNodeGeometry()); 
    964964 
    965         int pvsData = tData.mPvs; 
    966         float cData = (float)tData.mPvs * tData.mProbability; 
    967965 
    968966        // create new interior node and two leaf nodes 
     
    973971        if (1) 
    974972        { 
     973                int pvsData = tData.mPvs; 
     974                float cData = (float)pvsData * tData.mProbability; 
     975 
    975976                float cFront = (float)tFrontData.mPvs * tFrontData.mProbability; 
    976977                float cBack = (float)tBackData.mPvs * tBackData.mProbability; 
    977978                 
    978                 float costDecr =  
    979                         (cFront + cBack - cData) / mBox.GetVolume(); 
     979                Debug << "front pvs: " << tFrontData.mPvs << " p: " << tFrontData.mProbability << endl; 
     980                Debug << "back pvs: " << tBackData.mPvs << " p: " << tBackData.mProbability << endl; 
     981                Debug << "pvs: " << pvsData << " p: " << tData.mProbability << endl; 
     982 
     983                Debug << "data: " << cData << " front: " << cFront << " back: " << cBack << endl; 
     984                Debug << "cost ratio: " << (cFront + cBack) / cData << endl; 
     985 
     986                if ((cFront + cBack) / cData > 1) 
     987                        Debug << "ERROR!!" << endl; 
     988 
     989                float costDecr = (cFront + cBack - cData) / mBox.GetVolume(); 
    980990 
    981991                 
     
    10171027} 
    10181028 
     1029 
    10191030void BspTree::ExtractViewCells(BspTraversalData &frontData, 
    10201031                                                           BspTraversalData &backData,  
     
    10441055        } 
    10451056} 
     1057 
    10461058 
    10471059BspInterior *BspTree::SubdivideNode(BspTraversalData &tData, 
     
    10911103                                                                           interior->mPlane, 
    10921104                                                                           mBox, 
    1093                                                                            mEpsilon); 
     1105                                                                           0.000000000001); 
     1106                                                                           //mEpsilon); 
    10941107         
    10951108                 
     
    11031116                        frontData.mProbability = frontData.mGeometry->GetVolume(); 
    11041117                        backData.mProbability = tData.mProbability - frontData.mProbability; 
     1118 
     1119                        Debug << "************" << endl; 
     1120                        Debug << "plane: " << interior->mPlane << endl; 
     1121                        Debug << "box: " << mBox << endl; 
     1122                        Debug << "all: " << tData.mProbability << " f: " << frontData.mProbability << " b: " << backData.mProbability << endl; 
     1123                        Debug << "real back: " << backData.mGeometry->GetVolume() << endl; 
     1124                        Debug << "data geom: " << tData.mGeometry->mPolys.size() << " f: " << frontData.mGeometry->mPolys.size() << " b: " << backData.mGeometry->mPolys.size() << endl; 
    11051125                } 
    11061126        } 
     
    14431463                const float candidateCost =  
    14441464                        SplitPlaneCost(poly->GetSupportingPlane(), data); 
     1465 
     1466                Debug << "supporting plane: " << poly->GetSupportingPlane() << endl; 
    14451467 
    14461468                if (candidateCost < lowestCost) 
     
    19822004                        if (!leaf->mViewCell->Mailed()) 
    19832005                        { 
    1984                           //                            ray.bspIntersections.push_back(Ray::BspIntersection(maxt, leaf)); 
     2006                                //ray.bspIntersections.push_back(Ray::BspIntersection(maxt, leaf)); 
    19852007                                leaf->mViewCell->Mail(); 
    19862008                                ++ hits; 
     
    20612083                        else // ray and plane are coincident 
    20622084                        { 
    2063                                 // WHAT TO DO IN THIS CASE ? 
    2064                                 //break; 
    2065                                 node = in->GetFront(); 
    2066                                 continue; 
     2085                                // NOTE: what to do if ray is coincident with plane? 
     2086                                if (extSide < 0) 
     2087                                        node = in->GetBack(); 
     2088                                else  
     2089                                        node = in->GetFront(); 
     2090                                                                 
     2091                                continue; // no far child 
    20672092                        } 
    20682093                 
Note: See TracChangeset for help on using the changeset viewer.