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.6 by greg, Mon Jun 28 10:07:17 2004 UTC vs.
Revision 2.7 by greg, Mon Oct 25 22:57:45 2010 UTC

# Line 80 | Line 80 | o_cone(                        /* intersect ray with cone */
80                          return(0);                      /* outside radii */
81                  r->ro = o;
82                  r->rot = root[0];
83 <                for (i = 0; i < 3; i++)
84 <                        r->rop[i] = r->rorg[i] + r->rdir[i]*r->rot;
83 >                VSUM(r->rop, r->rorg, r->rdir, r->rot);
84                  VCOPY(r->ron, co->ad);
85                  r->rod = -rdx[2];
86                  r->rox = NULL;
# Line 96 | Line 95 | o_cone(                        /* intersect ray with cone */
95                  if (root[rn] >= r->rot)
96                          break;                  /* too big */
97                                                  /* check endpoints */
98 <                for (i = 0; i < 3; i++) {
99 <                        rox[i] = r->rorg[i] + root[rn]*r->rdir[i];
101 <                        rdx[i] = rox[i] - CO_P0(co)[i];
102 <                }
98 >                VSUM(rox, r->rorg, r->rdir, root[rn]);
99 >                VSUB(rdx, rox, CO_P0(co));
100                  b = DOT(rdx, co->ad);
101                  if (b < 0.0)
102                          continue;               /* before p0 */
# Line 126 | Line 123 | o_cone(                        /* intersect ray with cone */
123                  if (o->otype == OBJ_CONE || o->otype == OBJ_CUP)
124                          for (i = 0; i < 3; i++)
125                                  r->ron[i] = (co->al*r->ron[i] - c*co->ad[i])
126 <                                                /co->sl;
126 >                                                / co->sl;
127                  a = DOT(r->ron, r->ron);
128                  if (a > 1.+FTINY || a < 1.-FTINY) {
129                          c = 1./(.5 + .5*a);     /* avoid numerical error */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines