Ignore:
Timestamp:
03/23/07 01:40:24 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
2 edited

Legend:

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

    r2233 r2283  
    17781778                { 
    17791779                        const int randIdx =  
    1780                                 (int)RandomValue(0, (Real)((int)data.mPolygons->size() - 1)); 
     1780                                (int)RandomValue(0, (Real)((float)data.mPolygons->size() - 0.5f)); 
    17811781                        Polygon3 *nextPoly = (*data.mPolygons)[randIdx]; 
    17821782 
     
    18141814                // swap candidate to the end to avoid testing same plane 
    18151815                std::swap((*data.mPolygons)[maxIdx], (*data.mPolygons)[candidateIdx]); 
    1816                 //Polygon3 *poly = (*data.mPolygons)[(int)RandomValue(0, (int)polys.size() - 1)]; 
    1817  
     1816         
    18181817                // evaluate current candidate 
    18191818                BspNodeGeometry fGeom, bGeom; 
     
    18951894Plane3 VspBspTree::ChooseCandidatePlane(const RayInfoContainer &rays) const 
    18961895{ 
    1897         const int candidateIdx = (int)RandomValue(0, (Real)((int)rays.size() - 1)); 
     1896        const int candidateIdx = (int)RandomValue(0, (Real)((float)rays.size() - 0.5f)); 
    18981897 
    18991898        const Vector3 minPt = rays[candidateIdx].ExtrapOrigin(); 
     
    21032102        { 
    21042103                const int testIdx = useRand ?  
    2105                         (int)RandomValue(0, (Real)((int)data.mRays->size() - 1)) : i; 
     2104                        (int)RandomValue(0, (Real)((float)data.mRays->size() - 0.5f)) : i; 
    21062105                RayInfo rayInf = (*data.mRays)[testIdx]; 
    21072106 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp

    r2199 r2283  
    283283                Intersectable *sourceObj = mObjects[5]; 
    284284 
    285                 const int index = (int)RandomValue(0, (Real)((int)leaves.size() - 1)); 
     285                const int index = (int)RandomValue(0, (Real)((float)leaves.size() - 0.5f)); 
    286286                VssTreeLeaf *leaf = leaves[index]; 
    287287 
Note: See TracChangeset for help on using the changeset viewer.