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.8 by gregl, Thu Nov 20 10:52:57 1997 UTC vs.
Revision 3.10 by gregl, Thu Dec 18 09:33:12 1997 UTC

# Line 199 | Line 199 | register GCOORD        *gc;
199   }
200  
201  
202 < hdlseg(lseg, hp, i)                     /* compute line segment for beam */
202 > hdlseg(lseg, hp, gc)                    /* compute line segment for beam */
203   register int    lseg[2][3];
204   register HOLO   *hp;
205 < int     i;
205 > GCOORD  gc[2];
206   {
207        GCOORD  gc[2];
207          register int    k;
208  
210        if (!hdbcoord(gc, hp, i))               /* compute grid coordinates */
211                return(0);
209          for (k = 0; k < 2; k++) {               /* compute end points */
210                  lseg[k][gc[k].w>>1] = gc[k].w&1 ? hp->grid[gc[k].w>>1]-1 : 0 ;
211                  lseg[k][wg0[gc[k].w]] = gc[k].i[0];
# Line 299 | Line 296 | BYTE   r[2][2];
296  
297  
298   double
299 < hdinter(gc, r, hp, ro, rd)      /* compute ray intersection with section */
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 */
302 + double  *ed;            /* returned (optional) */
303   register HOLO   *hp;
304   FVECT   ro, rd;         /* rd should be normalized */
305   {
# Line 362 | Line 360 | FVECT  ro, rd;         /* rd should be normalized */
360                          return(FHUGE);          /* outside wall */
361                  r[i][1] = 256. * (d - gc[i].i[1]);
362          }
363 <                                        /* return distance from entry point */
364 <        vt[0] = ro[0] - p[0][0];
365 <        vt[1] = ro[1] - p[0][1];
366 <        vt[2] = ro[2] - p[0][2];
369 <        return(DOT(vt,rd));
363 >
364 >        if (ed != NULL)                 /* assign distance to exit point */
365 >                *ed = t1;
366 >        return(t0);                     /* return distance to entry point */
367   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines