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.17 by greg, Sat Feb 22 02:07:24 2003 UTC vs.
Revision 3.20 by schorsch, Sun Jul 27 22:12:02 2003 UTC

# Line 35 | Line 35 | register HOLO  *hp;
35          for (i = 0; i < 3; i++) {
36                  fcross(hp->wg[i], hp->xv[(i+1)%3], hp->xv[(i+2)%3]);
37                  d = DOT(hp->wg[i],hp->xv[i]);
38 <                if (d <= FTINY & d >= -FTINY)
38 >                if ((d <= FTINY) & (d >= -FTINY))
39                          error(USER, "degenerate holodeck section");
40                  d = hp->grid[i] / d;
41                  hp->wg[i][0] *= d; hp->wg[i][1] *= d; hp->wg[i][2] *= d;
# Line 63 | Line 63 | register int   i;
63          int     n2, reverse;
64          GCOORD  g2[2];
65                                          /* check range */
66 <        if (i < 1 | i > nbeams(hp))
66 >        if ((i < 1) | (i > nbeams(hp)))
67                  return(0);
68 <        if (reverse = i >= hp->wi[5])
68 >        if ( (reverse = i >= hp->wi[5]) )
69                  i -= hp->wi[5] - 1;
70          for (j = 0; j < 5; j++)         /* find w0 */
71                  if (hp->wi[j+1] > i)
# Line 90 | Line 90 | register int   i;
90          gc[1].i[1] = i / hp->grid[hdwg0[gc[1].w]];
91          gc[1].i[0] = i - gc[1].i[1]*hp->grid[hdwg0[gc[1].w]];
92          if (reverse) {
93 <                copystruct(g2, gc+1);
94 <                copystruct(gc+1, gc);
95 <                copystruct(gc, g2);
93 >                *g2 = *(gc+1);
94 >                *(gc+1) = *gc;
95 >                *gc = *g2;
96          }
97          return(1);                      /* we're done */
98   }
# Line 107 | Line 107 | register GCOORD        gc[2];
107          int     reverse;
108          register int    i, j;
109                                          /* check ordering and limits */
110 <        if (reverse = gc[0].w > gc[1].w) {
111 <                copystruct(g2, gc+1);
112 <                copystruct(g2+1, gc);
110 >        if ( (reverse = gc[0].w > gc[1].w) ) {
111 >                *g2 = *(gc+1);
112 >                *(g2+1) = *gc;
113                  gc = g2;
114          } else if (gc[0].w == gc[1].w)
115                  return(0);
116 <        if (gc[0].w < 0 | gc[1].w > 5)
116 >        if ((gc[0].w < 0) | (gc[1].w > 5))
117                  return(0);
118          i = 0;                          /* compute index */
119          for (j = gc[0].w+1; j < gc[1].w; j++)
# Line 134 | Line 134 | register FVECT cp[4];  /* returned (may be passed as FV
134   register HOLO   *hp;
135   register GCOORD *gc;
136   {
137 <        register FLOAT  *v;
137 >        register RREAL  *v;
138          double  d;
139                                          /* compute common component */
140          VCOPY(cp[0], hp->orig);
# Line 263 | Line 263 | FVECT  ro, rd;         /* normalization of rd affects distance
263   {
264          FVECT   p[2], vt;
265          double  d, t0, t1, d0, d1;
266 <        register FLOAT  *v;
266 >        register RREAL  *v;
267          register int    i;
268                                          /* first, intersect walls */
269          gc[0].w = gc[1].w = -1;
# Line 296 | Line 296 | FVECT  ro, rd;         /* normalization of rd affects distance
296                          }
297                  }
298          }
299 <        if (gc[0].w < 0 | gc[1].w < 0)          /* paranoid check */
299 >        if ((gc[0].w < 0) | (gc[1].w < 0))              /* paranoid check */
300                  return(FHUGE);
301                                                  /* compute intersections */
302          VSUM(p[0], ro, rd, t0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines