ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/o_face.c
(Generate patch)

Comparing ray/src/rt/o_face.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:41:32 1989 UTC vs.
Revision 2.3 by greg, Tue Feb 25 02:47:23 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1986 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  o_face.c - compute ray intersection with faces.
9 *
10 *     8/29/85
6   */
7  
8 + #include "copyright.h"
9 +
10   #include  "ray.h"
11  
12   #include  "face.h"
# Line 41 | Line 38 | register RAY  *r;
38          if (rdot <= FTINY && rdot >= -FTINY)    /* ray parallels plane */
39                  t = FHUGE;
40          else
41 <                t = (DOT(r->rorg, f->norm) - f->const) / rdot;
41 >                t = (DOT(r->rorg, f->norm) - f->offset) / rdot;
42          
43          if (t <= FTINY || t >= r->rot)          /* not good enough */
44                  return(0);
# Line 49 | Line 46 | register RAY  *r;
46          for (i = 0; i < 3; i++)
47                  pisect[i] = r->rorg[i] + r->rdir[i]*t;
48  
49 <        if (inface(pisect, f)) {                /* ray intersects face? */
49 >        if (!inface(pisect, f))                 /* ray intersects face? */
50 >                return(0);
51  
52 <                r->ro = o;
53 <                r->rot = t;
54 <                VCOPY(r->rop, pisect);
55 <                VCOPY(r->ron, f->norm);
56 <                r->rod = rdot;
57 <        }
52 >        r->ro = o;
53 >        r->rot = t;
54 >        VCOPY(r->rop, pisect);
55 >        VCOPY(r->ron, f->norm);
56 >        r->rod = rdot;
57 >        r->rox = NULL;
58 >
59          return(1);                              /* hit */
60   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines