Ignore:
Timestamp:
02/14/06 17:13:42 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r508 r639  
    106106                mMaxT = t;  
    107107        } 
    108          
    109108#endif  
     109 
    110110 
    111111int RayInfo::ComputeRayIntersection(const int axis, const float position, float &t) const 
     
    133133{        
    134134        t = splitPlane.FindT(mRay->GetOrigin(), mRay->GetTermination()); 
    135 //      Debug << "t: " << t << " mint " << GetMinT() << " maxt " << GetMaxT() <<  
    136 //      " orig: " << mRay->GetOrigin() << " term " << mRay->GetTermination() << endl; 
     135 
     136        if (0) 
     137                Debug << "t: " << t << " mint " << GetMinT() << " maxt " << GetMaxT()  
     138                      << " orig: " << mRay->GetOrigin() << " term " << mRay->GetTermination() << endl; 
    137139 
    138140        // NOTE: if plane equals end point of ray, the ray should be classified 
    139141        // non-intersecting, otherwise polygon-plane intersections of bsp tree 
    140142        // approaches are not eliminating any rays intersecting the polygon! 
    141 #if 1 
    142         if (t >= GetMaxT() - 1e-20) 
     143        const float thresh = 1 ? 1e-6f : 0.0f; 
     144 
     145        // segment is not intersecting plane: fond out if on front or back side 
     146        if (t >= GetMaxT() - thresh) 
     147        { 
    143148                return splitPlane.Side(ExtrapOrigin()); 
    144         if (t <= GetMinT() + 1e-20) 
     149        } 
     150                 
     151        if (t <= GetMinT() + thresh) 
     152        { 
    145153                return splitPlane.Side(ExtrapTermination()); 
    146 #else 
    147         if (t > GetMaxT()) 
    148                 return splitPlane.Side(ExtrapOrigin()); 
    149         else if (t < GetMinT()) 
    150                 return splitPlane.Side(ExtrapTermination()); 
    151 #endif 
     154        } 
     155         
    152156        return 0; 
    153157} 
     158 
    154159 
    155160float RayInfo::SegmentLength() const 
Note: See TracChangeset for help on using the changeset viewer.