Ignore:
Timestamp:
02/10/06 13:04:39 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r610 r611  
    426426                                                          prop, 
    427427                                                          geom); 
    428  
     428#if OCTREE_HACK 
     429tData.mAxis = 0; 
     430#endif 
    429431        // first node is kd node, i.e. an axis aligned box 
    430432        if (1) 
     
    528530                VspBspTraversalData tFrontData; 
    529531                VspBspTraversalData tBackData; 
    530  
     532#if OCTREE_HACK 
     533                //Debug << "new axis:" << (tData.mAxis + 1) % 3 << endl; 
     534 
     535                tFrontData.mAxis = (tData.mAxis + 1) % 3; 
     536                tBackData.mAxis = (tData.mAxis + 1) % 3; 
     537#endif 
    531538                // create new interior node and two leaf nodes 
    532539                // or return leaf as it is (if maxCostRatio missed) 
     
    537544                        if (1) 
    538545                        { 
    539                                 float cFront = tFrontData.mPvs * tFrontData.mProbability; 
    540                                 float cBack = tBackData.mPvs * tBackData.mProbability; 
    541                                 float cData = tData.mPvs * tData.mProbability;; 
     546                                float cFront = (float)tFrontData.mPvs * tFrontData.mProbability; 
     547                                float cBack = (float)tBackData.mPvs * tBackData.mProbability; 
     548                                float cData = (float)tData.mPvs * tData.mProbability;; 
    542549 
    543550                float costDecr =  
    544551                                        (cFront + cBack - cData) / mBox.GetVolume(); 
    545  
    546                                 int pvsFront = tFrontData.mPvs * tFrontData.mProbability; 
    547                                 int pvsBack = tBackData.mPvs * tBackData.mProbability; 
    548                                 int pvsData = tData.mPvs * tData.mProbability;; 
    549552 
    550553                                mTotalCost += costDecr; 
     
    979982                        box.Include((*ri).ExtrapTermination()); 
    980983        } 
    981  
     984#if OCTREE_HACK 
     985        //Debug << "choosing axis:" << tData.mAxis << endl; 
     986        const int sAxis = tData.mAxis; 
     987#else 
    982988        const int sAxis = mUseRandomAxis ? Random(3) : box.Size().DrivingAxis(); 
    983  
     989#endif 
    984990        for (axis = 0; axis < 3; ++ axis) 
    985991        { 
     
    11301136 
    11311137        // cost ratio miss 
    1132         if (!mUsePolygonSplitIfAvailable || data.mPolygons->empty()) 
     1138        if (mUsePolygonSplitIfAvailable && !data.mPolygons->empty()) 
    11331139        { 
    11341140                frontData.mIsKdNode = backData.mIsKdNode = false; 
     
    11831189        // cost ratio miss 
    11841190        if (lowestCost > mTermMaxCostRatio) 
     1191        { 
    11851192                return false; 
     1193        } 
    11861194 
    11871195        return true; 
     
    16291637        if (data.mDepth >= mTermMaxDepth) 
    16301638                ++ mBspStats.maxDepthNodes; 
     1639 
    16311640        // accumulate rays to compute rays /  leaf 
    16321641        mBspStats.accumRays += (int)data.mRays->size(); 
Note: See TracChangeset for help on using the changeset viewer.