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

Comparing ray/src/rt/o_cone.c (file contents):
Revision 2.9 by greg, Thu Apr 21 00:40:35 2016 UTC vs.
Revision 2.10 by greg, Sun Jan 31 18:08:04 2021 UTC

# Line 70 | Line 70 | o_cone(                        /* intersect ray with cone */
70  
71          } else { /* OBJ_RING */
72  
73 <                if (rdx[2] <= FTINY && rdx[2] >= -FTINY)
73 >                if ((rdx[2] <= FTINY) & (rdx[2] >= -FTINY))
74                          return(0);                      /* parallel */
75                  root[0] = -rox[2]/rdx[2];
76 <                if (root[0] <= FTINY || root[0] >= r->rot)
77 <                        return(0);                      /* distance check */
76 >                if (rayreject(o, r, root[0]))
77 >                        return(0);                      /* have better */
78                  b = root[0]*rdx[0] + rox[0];
79                  c = root[0]*rdx[1] + rox[1];
80                  a = b*b + c*c;
# Line 94 | Line 94 | o_cone(                        /* intersect ray with cone */
94          for (rn = 0; rn < nroots; rn++) {       /* check real roots */
95                  if (root[rn] <= FTINY)
96                          continue;               /* too small */
97 <                if (root[rn] >= r->rot)
97 >                if (root[rn] > r->rot + FTINY)
98                          break;                  /* too big */
99                                                  /* check endpoints */
100                  VSUM(rox, r->rorg, r->rdir, root[rn]);
# Line 104 | Line 104 | o_cone(                        /* intersect ray with cone */
104                          continue;               /* before p0 */
105                  if (b > co->al)
106                          continue;               /* after p1 */
107 +                if (rayreject(o, r, root[rn]))
108 +                        break;                  /* previous hit better */
109                  r->ro = o;
110                  r->rot = root[rn];
111                  VCOPY(r->rop, rox);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines