Ignore:
Timestamp:
10/17/05 21:51:45 (19 years ago)
Author:
bittner
Message:

code merge

File:
1 edited

Legend:

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

    r311 r333  
    163163      bool mOnlyDrivingAxis = false; 
    164164      if (mOnlyDrivingAxis) { 
    165         axis = box.Size().DrivingAxis(); 
    166         costRatio = BestCostRatio(leaf, 
    167                                   box, 
    168                                   axis, 
    169                                   position, 
    170                                   objectsBack, 
    171                                   objectsFront); 
     165                                axis = box.Size().DrivingAxis(); 
     166                                costRatio = BestCostRatio(leaf, 
     167                                                                                                                                        box, 
     168                                                                                                                                        axis, 
     169                                                                                                                                        position, 
     170                                                                                                                                        objectsBack, 
     171                                                                                                                                        objectsFront); 
    172172      } else { 
    173         costRatio = MAX_FLOAT; 
    174         for (int i=0; i < 3; i++) { 
    175           float p; 
    176           float r = BestCostRatio(leaf, 
    177                                   box, 
    178                                   i, 
    179                                   p, 
    180                                   objectsBack, 
    181                                   objectsFront); 
    182           if (r < costRatio) { 
    183             costRatio = r; 
    184             axis = i; 
    185             position = p; 
    186           } 
    187         } 
     173                                costRatio = MAX_FLOAT; 
     174                                for (int i=0; i < 3; i++) { 
     175                                        float p; 
     176                                        float r = BestCostRatio(leaf, 
     177                                                                                                                                        box, 
     178                                                                                                                                        i, 
     179                                                                                                                                        p, 
     180                                                                                                                                        objectsBack, 
     181                                                                                                                                        objectsFront); 
     182                                        if (r < costRatio) { 
     183                                                costRatio = r; 
     184                                                axis = i; 
     185                                                position = p; 
     186                                        } 
     187                                } 
    188188      } 
    189189       
    190190      if (costRatio > mMaxCostRatio) { 
    191         //      cout<<"Too big cost ratio "<<costRatio<<endl; 
    192         axis = -1; 
     191                                //      cout<<"Too big cost ratio "<<costRatio<<endl; 
     192                                axis = -1; 
    193193      } 
    194194      break; 
     
    415415float 
    416416KdTree::BestCostRatio( 
    417                       KdLeaf *node, 
    418                       const AxisAlignedBox3 &box, 
    419                       const int axis, 
    420                       float &position, 
    421                       int &objectsBack, 
    422                       int &objectsFront 
    423                       ) 
     417                                                                                        KdLeaf *node, 
     418                                                                                        const AxisAlignedBox3 &box, 
     419                                                                                        const int axis, 
     420                                                                                        float &position, 
     421                                                                                        int &objectsBack, 
     422                                                                                        int &objectsFront 
     423                                                                                        ) 
    424424{ 
    425425 
     
    439439      totalIntersections += (*ci).intersectable->IntersectionComplexity(); 
    440440    } 
    441  
     441         
    442442  float intersectionsLeft = 0; 
    443443  float intersectionsRight = totalIntersections; 
    444  
     444         
    445445  int objectsLeft = 0, objectsRight = node->mObjects.size(); 
    446446   
Note: See TracChangeset for help on using the changeset viewer.