Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Triangle :: Intersect ( Ray & r , double & t )
- {
- double vd = n & r . Dir ;
- if ( vd > - EPS && vd < EPS ) return 0 ;
- if (( t = ( ( Loc - r . Org ) & n ) / vd ) < GeomThreshold ) return 0 ;
- Vector p = r . Point ( t ) ;
- double u = u0 + ( p & ku ) ;
- double v = v0 + ( p & kv ) ;
- return u > 0 && v > 0 && u + v < 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement