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.5 by schorsch, Tue Mar 30 16:13:01 2004 UTC vs.
Revision 2.6 by greg, Mon Jun 28 10:07:17 2004 UTC

# Line 127 | Line 127 | o_cone(                        /* intersect ray with cone */
127                          for (i = 0; i < 3; i++)
128                                  r->ron[i] = (co->al*r->ron[i] - c*co->ad[i])
129                                                  /co->sl;
130 +                a = DOT(r->ron, r->ron);
131 +                if (a > 1.+FTINY || a < 1.-FTINY) {
132 +                        c = 1./(.5 + .5*a);     /* avoid numerical error */
133 +                        r->ron[0] *= c; r->ron[1] *= c; r->ron[2] *= c;
134 +                }
135                  r->rod = -DOT(r->rdir, r->ron);
136                  r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
137                  r->uv[0] = r->uv[1] = 0.0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines