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

Comparing ray/src/rt/func.c (file contents):
Revision 2.16 by greg, Tue Mar 11 17:08:55 2003 UTC vs.
Revision 2.17 by greg, Wed Apr 23 01:31:50 2003 UTC

# Line 63 | Line 63 | int  dofwd;
63                  scompile("Ix=$16;Iy=$17;Iz=$18;", NULL, 0);
64                  scompile("Jx=$19;Jy=$20;Jz=$21;", NULL, 0);
65                  scompile("Kx=$22;Ky=$23;Kz=$24;", NULL, 0);
66 <                scompile("Lu=$25;Lv=$26;", NULL, 0);
66 >                scompile("Lu=$26;Lv=$27;", NULL, 0);
67                  funset("arg", 1, '=', l_arg);
68                  funset("erf", 1, ':', l_erf);
69                  funset("erfc", 1, ':', l_erfc);
# Line 257 | Line 257 | register int  n;
257          if (--n < 0)
258                  goto badchan;
259  
260 <        if (n < 3)                      /* ray direction */
260 >        if (n <= 2)                     /* ray direction */
261  
262                  return( (       fray->rdir[0]*funcxf.xfm[0][n] +
263                                  fray->rdir[1]*funcxf.xfm[1][n] +
264                                  fray->rdir[2]*funcxf.xfm[2][n]  )
265                           / funcxf.sca );
266  
267 <        if (n < 6)                      /* surface normal */
267 >        if (n <= 5)                     /* surface normal */
268  
269                  return( (       fray->ron[0]*funcxf.xfm[0][n-3] +
270                                  fray->ron[1]*funcxf.xfm[1][n-3] +
271                                  fray->ron[2]*funcxf.xfm[2][n-3] )
272                           / funcxf.sca );
273  
274 <        if (n < 9)                      /* intersection */
274 >        if (n <= 8)                     /* intersection */
275  
276                  return( fray->rop[0]*funcxf.xfm[0][n-6] +
277                                  fray->rop[1]*funcxf.xfm[1][n-6] +
# Line 289 | Line 289 | register int  n;
289          if (n == 11)                    /* scale */
290                  return(funcxf.sca);
291  
292 <        if (n < 15)                     /* origin */
292 >        if (n <= 14)                    /* origin */
293                  return(funcxf.xfm[3][n-12]);
294  
295 <        if (n < 18)                     /* i unit vector */
295 >        if (n <= 17)                    /* i unit vector */
296                  return(funcxf.xfm[0][n-15] / funcxf.sca);
297  
298 <        if (n < 21)                     /* j unit vector */
299 <                return(funcxf.xfm[1][n-15] / funcxf.sca);
298 >        if (n <= 20)                    /* j unit vector */
299 >                return(funcxf.xfm[1][n-18] / funcxf.sca);
300  
301 <        if (n < 24)                     /* k unit vector */
301 >        if (n <= 23)                    /* k unit vector */
302                  return(funcxf.xfm[2][n-21] / funcxf.sca);
303  
304 <        if (n < 25)                     /* single ray (shadow) distance */
304 >        if (n == 24)                    /* single ray (shadow) distance */
305                  return((fray->rot+raydist(fray->parent,SHADOW)) * funcxf.sca);
306  
307 <        if (n < 27)                     /* local (u,v) coordinates */
308 <                return(fray->uv[n-26]);
307 >        if (n <= 26)                    /* local (u,v) coordinates */
308 >                return(fray->uv[n-25]);
309   badchan:
310          error(USER, "illegal channel number");
311          return(0.0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines