Changeset 711 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
- Timestamp:
- 03/20/06 16:55:40 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r710 r711 467 467 } 468 468 469 469 470 BspViewCell *BspTree::GetOrCreateOutOfBoundsCell() 470 471 { … … 1706 1707 1707 1708 // construct child geometry with regard to the candidate split plane 1708 BspNodeGeometry frontCell; 1709 BspNodeGeometry backCell; 1710 1711 cell.SplitGeometry(frontCell, 1712 backCell, 1713 candidatePlane, 1714 mBox, 1715 mEpsilon); 1709 BspNodeGeometry geomFront; 1710 BspNodeGeometry geomBack; 1711 1712 const bool splitSuccessFull = 1713 cell.SplitGeometry(geomFront, 1714 geomBack, 1715 candidatePlane, 1716 mBox, 1717 mEpsilon); 1716 1718 1717 1719 if (mUseAreaForPvs) 1718 1720 { 1719 pFront = frontCell.GetArea();1720 pBack = backCell.GetArea();1721 pFront = geomFront.GetArea(); 1722 pBack = geomBack.GetArea(); 1721 1723 } 1722 1724 else 1723 1725 { 1724 pFront = frontCell.GetVolume();1726 pFront = geomFront.GetVolume(); 1725 1727 pBack = pOverall - pFront; 1726 1728 } 1727 1729 1730 1731 // give penalty to unbalanced split 1732 if (1 && 1733 (!splitSuccessFull || (pFront <= 0) || (pBack <= 0) || 1734 !geomFront.Valid() || !geomBack.Valid())) 1735 { 1736 Debug << "error f: " << pFront << " b: " << pBack << endl; 1737 return 99999.9f; 1738 } 1728 1739 1729 1740 pOverall = probability; … … 1793 1804 val += mBalancedRaysFactor * fabs(sumBalancedRays) / raysSize; 1794 1805 1795 const float denom = pOverall * (float)pvs * 2.0f+ Limits::Small;1806 const float denom = pOverall * (float)pvs + Limits::Small; 1796 1807 1797 1808 if (mSplitPlaneStrategy & PVS) 1798 1809 { 1799 1810 val += mPvsFactor * (frontPvs * pFront + (backPvs * pBack)) / denom; 1800 1801 // give penalty to unbalanced split1802 if (0)1803 if (((pFront * 0.2 + Limits::Small) > pBack) ||1804 (pFront < (pBack * 0.2 + Limits::Small)))1805 val += 0.5;1806 1811 } 1807 1812 … … 1975 1980 } 1976 1981 1977 int 1978 BspTree::_CastRay(Ray &ray)1982 1983 int BspTree::_CastRay(Ray &ray) 1979 1984 { 1980 1985 int hits = 0; … … 3085 3090 const float epsilon) const 3086 3091 { 3087 #if 0 3088 // trivial cases 3089 const int cf = Side(splitPlane, epsilon); 3090 3091 if (cf == -1) 3092 { 3093 back = *this; 3094 return false; 3095 } 3096 else if (cf == 1) 3097 { 3098 front = *this; 3099 return false; 3100 } 3101 #endif 3092 //-- trivial cases 3093 if (0) 3094 { 3095 const int cf = Side(splitPlane, epsilon); 3096 3097 if (cf == -1) 3098 { 3099 back = *this; 3100 return false; 3101 } 3102 else if (cf == 1) 3103 { 3104 front = *this; 3105 return false; 3106 } 3107 } 3102 3108 3103 3109 // get cross section of new polygon
Note: See TracChangeset
for help on using the changeset viewer.