Changeset 333 for trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.cpp
- Timestamp:
- 10/17/05 21:51:45 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.cpp
r311 r333 163 163 bool mOnlyDrivingAxis = false; 164 164 if (mOnlyDrivingAxis) { 165 axis = box.Size().DrivingAxis();166 costRatio = BestCostRatio(leaf,167 168 169 170 171 165 axis = box.Size().DrivingAxis(); 166 costRatio = BestCostRatio(leaf, 167 box, 168 axis, 169 position, 170 objectsBack, 171 objectsFront); 172 172 } else { 173 costRatio = MAX_FLOAT;174 for (int i=0; i < 3; i++) {175 176 177 178 179 180 181 182 183 184 185 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 } 188 188 } 189 189 190 190 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; 193 193 } 194 194 break; … … 415 415 float 416 416 KdTree::BestCostRatio( 417 418 419 420 421 422 423 417 KdLeaf *node, 418 const AxisAlignedBox3 &box, 419 const int axis, 420 float &position, 421 int &objectsBack, 422 int &objectsFront 423 ) 424 424 { 425 425 … … 439 439 totalIntersections += (*ci).intersectable->IntersectionComplexity(); 440 440 } 441 441 442 442 float intersectionsLeft = 0; 443 443 float intersectionsRight = totalIntersections; 444 444 445 445 int objectsLeft = 0, objectsRight = node->mObjects.size(); 446 446
Note: See TracChangeset
for help on using the changeset viewer.