Changeset 1770 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
- Timestamp:
- 11/20/06 13:54:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1768 r1770 1344 1344 PrepareLocalSubdivisionCandidates(tData, axis); 1345 1345 1346 VssRayContainer rays;1347 // maximal 2 objects share the same ray1348 rays.reserve(tData.mNumRays * 2);1349 CollectRays(tData.mNode->mObjects, rays);1350 1351 const float prop = (float)mMaxTests / ((float)tData.mNumRays + Limits::Small);1352 1353 VssRay::NewMail();1354 1355 //cout << "here7 " << tData.mNumRays << " " << rays.size() << endl;1356 //cout << "here5 prop: " << prop << " " << mMaxTests << " " << tData.mNumRays << endl;1357 // only use a subset of the rays1358 VssRayContainer::const_iterator rit, rit_end = rays.end();1359 1360 int nRays = 0;1361 1362 for (rit = rays.begin(); rit != rit_end; ++ rit)1363 {1364 if ((mMaxTests >= (int)rays.size()) || (Random(1.0f) < prop))1365 {1366 (*rit)->Mail();1367 ++ nRays;1368 }1369 }1370 1371 //cout << "here99 " << nRays << " obj " << tData.mNode->mObjects.size() << endl;1372 1346 // collect and mark the view cells as belonging to front pvs 1373 1347 ViewCellContainer viewCells; … … 1469 1443 sAxis = box.Size().DrivingAxis(); 1470 1444 } 1471 1445 1446 1447 // only use a subset of the rays for visibility based heuristics 1448 if (mUseCostHeuristics && useVisibilityBasedHeuristics) 1449 { 1450 VssRayContainer rays; 1451 // maximal 2 objects share the same ray 1452 rays.reserve(tData.mNumRays * 2); 1453 CollectRays(tData.mNode->mObjects, rays); 1454 1455 const float prop = (float)mMaxTests / (float)tData.mNumRays; 1456 1457 VssRay::NewMail(); 1458 1459 VssRayContainer::const_iterator rit, rit_end = rays.end(); 1460 1461 int nRays = 0; 1462 1463 for (rit = rays.begin(); rit != rit_end; ++ rit) 1464 { 1465 if ((mMaxTests >= (int)rays.size()) || (Random(1.0f) < prop)) 1466 { 1467 (*rit)->Mail(); 1468 ++ nRays; 1469 } 1470 } 1471 } 1472 1472 1473 //////////////////////////////////// 1473 1474 //-- evaluate split cost for all three axis
Note: See TracChangeset
for help on using the changeset viewer.