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

Comparing ray/src/ot/o_face.c (file contents):
Revision 1.2 by greg, Tue Feb 21 14:44:49 1989 UTC vs.
Revision 1.3 by greg, Sat Oct 14 11:19:32 1989 UTC

# Line 54 | Line 54 | CUBE  *cu;
54                                  /* get face arguments */
55          f = getface(o);
56          if (f->area == 0.0)             /* empty face */
57 <                return(0);
57 >                return(O_MISS);
58                                          /* compute cube boundaries */
59          for (j = 0; j < 3; j++)
60                  cumax[j] = (cumin[j] = cu->cuorg[j]) + cu->cusize;
# Line 64 | Line 64 | CUBE  *cu;
64                  if (j = plocate(VERTEX(f,i), cumin, cumax))
65                          vloc &= j;
66                  else
67 <                        return(1);      /* vertex inside */
67 >                        return(O_HIT);  /* vertex inside */
68  
69          if (vloc)                       /* all to one side */
70 <                return(0);
70 >                return(O_MISS);
71          
72          for (i = 0; i < f->nv; i++) {   /* check edges */
73                  if ((j = i + 1) >= f->nv)
# Line 75 | Line 75 | CUBE  *cu;
75                  VCOPY(v1, VERTEX(f,i));         /* clip modifies */
76                  VCOPY(v2, VERTEX(f,j));         /* the vertices! */
77                  if (clip(v1, v2, cumin, cumax))
78 <                        return(1);              /* edge inside */
78 >                        return(O_HIT);          /* edge inside */
79          }
80                                          /* see if cube cuts plane */
81          for (j = 0; j < 3; j++)
# Line 87 | Line 87 | CUBE  *cu;
87                          v2[j] = cumin[j];
88                  }
89          if ((d1 = DOT(v1, f->norm) - f->offset) > FTINY)
90 <                return(0);
90 >                return(O_MISS);
91          if ((d2 = DOT(v2, f->norm) - f->offset) < -FTINY)
92 <                return(0);
92 >                return(O_MISS);
93                                          /* intersect face */
94          for (j = 0; j < 3; j++)
95                  v1[j] = (v1[j]*d2 - v2[j]*d1)/(d2 - d1);
96          if (inface(v1, f))
97 <                return(1);
97 >                return(O_HIT);
98          
99 <        return(0);              /* no intersection */
99 >        return(O_MISS);         /* no intersection */
100   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines