Ignore:
Timestamp:
07/24/06 18:21:32 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r1145 r1147  
    13581358                                          float &position) 
    13591359{ 
     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 
    13601371        const float minBox = box.Min(axis); 
    13611372        const float maxBox = box.Max(axis); 
     
    13661377        const float maxBand = minBox + mMaxBand * sizeBox; 
    13671378 
    1368         SortSplitCandidates(rays, axis, minBand, maxBand); 
     1379        SortSplitCandidates(usedRays, axis, minBand, maxBand); 
    13691380 
    13701381        // go through the lists, count the number of objects left and right 
     
    13911402        Intersectable::NewMail(); 
    13921403 
    1393         RayInfoContainer::const_iterator ri, ri_end = rays.end(); 
     1404        RayInfoContainer::const_iterator ri, ri_end = usedRays.end(); 
    13941405 
    13951406        // set all object as belonging to the front pvs 
     
    14861497                        sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 
    14871498 
     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 
    14881507                        //Debug  << "pos=" << (*ci).value << "\t pvs=(" <<  pvsl << "," << pvsr << ")" << endl; 
    14891508                        //Debug << "cost= " << sum << endl; 
     
    14941513 
    14951514                                minSum = sum; 
    1496                                 position = (*ci).value; 
     1515                                position = currentPos; 
    14971516                                 
    14981517                                pvsBack = pvsl; 
     
    15011520                } 
    15021521        } 
    1503          
    15041522         
    15051523        // -- compute cost 
     
    15601578        //TODO: for kd split geometry already is box => only take minmax vertices 
    15611579        if (1) 
    1562         { 
    1563                 // get bounding box from geometry 
     1580        {       // get bounding box from geometry 
    15641581                tData.mGeometry->GetBoundingBox(box); 
    15651582        } 
     
    15721589                        box.Include((*ri).ExtrapTermination()); 
    15731590        } 
     1591 
    15741592 
    15751593        int sAxis = 0; 
     
    16201638                        } 
    16211639                        else  
    1622                         { 
    1623                                 //-- split plane position is spatial median 
     1640                        {       //-- split plane position is spatial median 
    16241641 
    16251642                                nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 
Note: See TracChangeset for help on using the changeset viewer.