Changeset 2238 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
- Timestamp:
- 03/12/07 19:20:55 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r2237 r2238 1122 1122 // should use classical approach here ... 1123 1123 #if BOUND_RENDERCOST 1124 const float rcLeft = std::max(objectsLeft, MIN_RENDERCOST); 1125 const float rcRight = std::max(objectsRight, MIN_RENDERCOST); 1126 1124 1127 const float sum = noValidSplit ? 1e25f : objectsLeft * al + objectsRight * ar; 1125 1128 #else 1126 const float rcLeft = std::max(objectsLeft, MIN_RENDERCOST);1127 const float rcRight = std::max(objectsRight, MIN_RENDERCOST);1128 1129 1129 1130 const float sum = noValidSplit ? 1e25f : objectsLeft * al + objectsRight * ar; 1130 1131 1131 #endif 1132 1132 /*cout << "pos=" << (*cit).mPos << "\t q=(" << objectsLeft << "," << objectsRight <<")\t r=(" … … 1373 1373 float volRight = totalVol; 1374 1374 1375 #if 1//USE_BETTER_RENDERCOST_EST1376 1375 const float nTotalObjects = EvalAbsCost(tData.mNode->mObjects); 1377 1376 float nObjectsLeft = 0; 1378 1377 float nObjectsRight = nTotalObjects; 1379 #else1380 const int nTotalObjects = (int)EvalAbsCost(tData.mNode->mObjects);1381 int nObjectsLeft = 0;1382 int nObjectsRight = (int)nTotalObjects;1383 #endif1384 1378 1385 1379 const float viewSpaceVol = … … 1440 1434 1441 1435 #if BOUND_RENDERCOST 1436 1437 const float rcLeft = max(nObjectsLeft, MIN_RENDERCOST); 1438 const float rcRight = max(nObjectsRight, MIN_RENDERCOST); 1439 1440 // the heuristics 1441 const float sum = noValidSplit ? 1442 1e25f : volLeft * (float)rcLeft + volRight * (float)rcRight; 1443 #else 1444 1442 1445 // the heuristics 1443 1446 const float sum = noValidSplit ? 1444 1447 1e25f : volLeft * (float)nObjectsLeft + volRight * (float)nObjectsRight; 1445 #else1446 const float rcLeft = max(nObjectsLeft, MIN_RENDERCOST);1447 const float rcRight = max(nObjectsRight, MIN_RENDERCOST);1448 1449 // the heuristics1450 const float sum = noValidSplit ?1451 1e25f : volLeft * (float)rcLeft + volRight * (float)rcRight;1452 1453 1448 #endif 1454 1449 … … 1792 1787 VssRayContainer::const_iterator rit, rit_end = rays.end(); 1793 1788 1789 VssRay *lastVssRay = NULL; 1790 1794 1791 VssRay::NewMail(); 1795 1792 … … 1798 1795 VssRay *ray = (*rit); 1799 1796 1800 if (ray->mTerminationObject) 1801 { 1802 ray->mTerminationObject->GetOrCreateRays()->push_back(ray); 1803 if (!ray->Mailed()) 1797 // filter out double rays (last ray the same as this ray 1798 if (!lastVssRay || 1799 !(ray->mOrigin == lastVssRay->mTermination) || 1800 !(ray->mTermination == lastVssRay->mOrigin)) 1801 { 1802 //cout << "j"; 1803 if (ray->mTerminationObject) 1804 1804 { 1805 ray->Mail(); 1806 ++ nRays; 1805 ray->mTerminationObject->GetOrCreateRays()->push_back(ray); 1806 if (!ray->Mailed()) 1807 { 1808 ray->Mail(); 1809 ++ nRays; 1810 } 1807 1811 } 1808 }1809 1812 1810 1813 #if COUNT_ORIGIN_OBJECTS 1811 1814 1812 if (ray->mOriginObject) 1813 { 1814 cout << "o"; 1815 ray->mOriginObject->GetOrCreateRays()->push_back(ray); 1816 1817 if (!ray->Mailed()) 1815 if (ray->mOriginObject) 1818 1816 { 1819 ray->Mail(); 1820 ++ nRays; 1817 //cout << "o"; 1818 ray->mOriginObject->GetOrCreateRays()->push_back(ray); 1819 1820 if (!ray->Mailed()) 1821 { 1822 ray->Mail(); 1823 ++ nRays; 1824 } 1821 1825 } 1822 1826 }
Note: See TracChangeset
for help on using the changeset viewer.