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

Comparing ray/src/hd/holo.c (file contents):
Revision 3.10 by gregl, Thu Dec 18 09:33:12 1997 UTC vs.
Revision 3.11 by gregl, Fri Dec 19 11:49:19 1997 UTC

# Line 298 | Line 298 | BYTE   r[2][2];
298   double
299   hdinter(gc, r, ed, hp, ro, rd)  /* compute ray intersection with section */
300   register GCOORD gc[2];  /* returned */
301 < BYTE    r[2][2];        /* returned */
301 > BYTE    r[2][2];        /* returned (optional) */
302   double  *ed;            /* returned (optional) */
303   register HOLO   *hp;
304 < FVECT   ro, rd;         /* rd should be normalized */
304 > FVECT   ro, rd;         /* normalization of rd affects distances */
305   {
306          FVECT   p[2], vt;
307          double  d, t0, t1, d0, d1;
# Line 353 | Line 353 | FVECT  ro, rd;         /* rd should be normalized */
353                  d = DOT(vt, v) * hp->wg[wg0[gc[i].w]];
354                  if (d < 0. || (gc[i].i[0] = d) >= hp->grid[wg0[gc[i].w]])
355                          return(FHUGE);          /* outside wall */
356 <                r[i][0] = 256. * (d - gc[i].i[0]);
356 >                if (r != NULL)
357 >                        r[i][0] = 256. * (d - gc[i].i[0]);
358                  v = hp->wn[wg1[gc[i].w]];
359                  d = DOT(vt, v) * hp->wg[wg1[gc[i].w]];
360                  if (d < 0. || (gc[i].i[1] = d) >= hp->grid[wg1[gc[i].w]])
361                          return(FHUGE);          /* outside wall */
362 <                r[i][1] = 256. * (d - gc[i].i[1]);
362 >                if (r != NULL)
363 >                        r[i][1] = 256. * (d - gc[i].i[1]);
364          }
363
365          if (ed != NULL)                 /* assign distance to exit point */
366                  *ed = t1;
367          return(t0);                     /* return distance to entry point */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines