Changeset 611 for trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
- Timestamp:
- 02/10/06 13:04:39 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r610 r611 426 426 prop, 427 427 geom); 428 428 #if OCTREE_HACK 429 tData.mAxis = 0; 430 #endif 429 431 // first node is kd node, i.e. an axis aligned box 430 432 if (1) … … 528 530 VspBspTraversalData tFrontData; 529 531 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 531 538 // create new interior node and two leaf nodes 532 539 // or return leaf as it is (if maxCostRatio missed) … … 537 544 if (1) 538 545 { 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;; 542 549 543 550 float costDecr = 544 551 (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;;549 552 550 553 mTotalCost += costDecr; … … 979 982 box.Include((*ri).ExtrapTermination()); 980 983 } 981 984 #if OCTREE_HACK 985 //Debug << "choosing axis:" << tData.mAxis << endl; 986 const int sAxis = tData.mAxis; 987 #else 982 988 const int sAxis = mUseRandomAxis ? Random(3) : box.Size().DrivingAxis(); 983 989 #endif 984 990 for (axis = 0; axis < 3; ++ axis) 985 991 { … … 1130 1136 1131 1137 // cost ratio miss 1132 if ( !mUsePolygonSplitIfAvailable ||data.mPolygons->empty())1138 if (mUsePolygonSplitIfAvailable && !data.mPolygons->empty()) 1133 1139 { 1134 1140 frontData.mIsKdNode = backData.mIsKdNode = false; … … 1183 1189 // cost ratio miss 1184 1190 if (lowestCost > mTermMaxCostRatio) 1191 { 1185 1192 return false; 1193 } 1186 1194 1187 1195 return true; … … 1629 1637 if (data.mDepth >= mTermMaxDepth) 1630 1638 ++ mBspStats.maxDepthNodes; 1639 1631 1640 // accumulate rays to compute rays / leaf 1632 1641 mBspStats.accumRays += (int)data.mRays->size();
Note: See TracChangeset
for help on using the changeset viewer.