Changeset 1147 for GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
- Timestamp:
- 07/24/06 18:21:32 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r1145 r1147 1358 1358 float &position) 1359 1359 { 1360 RayInfoContainer usedRays, savedRays; 1361 1362 /* if (mMaxTests < rays.size()) 1363 { 1364 GetRaySets(rays, mMaxTests, usedRays, savedRays); 1365 } 1366 else 1367 {*/ 1368 usedRays = rays; 1369 //} 1370 1360 1371 const float minBox = box.Min(axis); 1361 1372 const float maxBox = box.Max(axis); … … 1366 1377 const float maxBand = minBox + mMaxBand * sizeBox; 1367 1378 1368 SortSplitCandidates( rays, axis, minBand, maxBand);1379 SortSplitCandidates(usedRays, axis, minBand, maxBand); 1369 1380 1370 1381 // go through the lists, count the number of objects left and right … … 1391 1402 Intersectable::NewMail(); 1392 1403 1393 RayInfoContainer::const_iterator ri, ri_end = rays.end();1404 RayInfoContainer::const_iterator ri, ri_end = usedRays.end(); 1394 1405 1395 1406 // set all object as belonging to the front pvs … … 1486 1497 sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 1487 1498 1499 float currentPos; 1500 1501 // HACK: current positition is BETWEEN visibility events 1502 if ((ci + 1) != ci_end) 1503 currentPos = ((*ci).value + (*(ci + 1)).value) * 0.5f; 1504 else 1505 currentPos = (*ci).value; 1506 1488 1507 //Debug << "pos=" << (*ci).value << "\t pvs=(" << pvsl << "," << pvsr << ")" << endl; 1489 1508 //Debug << "cost= " << sum << endl; … … 1494 1513 1495 1514 minSum = sum; 1496 position = (*ci).value;1515 position = currentPos; 1497 1516 1498 1517 pvsBack = pvsl; … … 1501 1520 } 1502 1521 } 1503 1504 1522 1505 1523 // -- compute cost … … 1560 1578 //TODO: for kd split geometry already is box => only take minmax vertices 1561 1579 if (1) 1562 { 1563 // get bounding box from geometry 1580 { // get bounding box from geometry 1564 1581 tData.mGeometry->GetBoundingBox(box); 1565 1582 } … … 1572 1589 box.Include((*ri).ExtrapTermination()); 1573 1590 } 1591 1574 1592 1575 1593 int sAxis = 0; … … 1620 1638 } 1621 1639 else 1622 { 1623 //-- split plane position is spatial median 1640 { //-- split plane position is spatial median 1624 1641 1625 1642 nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f;
Note: See TracChangeset
for help on using the changeset viewer.