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.2 by greg, Tue Feb 21 14:56:20 1989 UTC vs.
Revision 2.5 by schorsch, Tue Mar 30 16:13:01 2004 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  "ray.h"
8 > #include "copyright.h"
9  
10 + #include  "ray.h"
11   #include  "face.h"
12 + #include  "rtotypes.h"
13  
14  
15 < o_face(o, r)            /* compute intersection with polygonal face */
16 < OBJREC  *o;
17 < register RAY  *r;
15 > extern int
16 > o_face(         /* compute intersection with polygonal face */
17 >        OBJREC  *o,
18 >        register RAY  *r
19 > )
20   {
21          double  rdot;           /* direction . normal */
22          double  t;              /* distance to intersection */
# Line 49 | Line 48 | register RAY  *r;
48          for (i = 0; i < 3; i++)
49                  pisect[i] = r->rorg[i] + r->rdir[i]*t;
50  
51 <        if (inface(pisect, f)) {                /* ray intersects face? */
51 >        if (!inface(pisect, f))                 /* ray intersects face? */
52 >                return(0);
53  
54 <                r->ro = o;
55 <                r->rot = t;
56 <                VCOPY(r->rop, pisect);
57 <                VCOPY(r->ron, f->norm);
58 <                r->rod = rdot;
59 <        }
54 >        r->ro = o;
55 >        r->rot = t;
56 >        VCOPY(r->rop, pisect);
57 >        VCOPY(r->ron, f->norm);
58 >        r->rod = rdot;
59 >        r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
60 >        r->uv[0] = r->uv[1] = 0.0;
61 >        r->rox = NULL;
62 >
63          return(1);                              /* hit */
64   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines