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.19 by schorsch, Mon Jul 21 22:30:19 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 185 | Line 185 | register RAY  *r;
185                          funcxf.sca = r->rox->b.sca * f->b->sca;
186                          multmat4(funcxf.xfm, r->rox->b.xfm, f->b->xfm);
187                  } else
188 <                        copystruct(&funcxf, &r->rox->b);
188 >                        funcxf = r->rox->b;
189          else
190 <                copystruct(&funcxf, f->b);
190 >                funcxf = *(f->b);
191          lastrno = r->rno;
192          eclock++;               /* notify expression evaluator */
193          return(1);
# Line 200 | Line 200 | char  *fname;
200   {
201          char  *ffname;
202  
203 <        if ((ffname = getpath(fname, getlibpath(), R_OK)) == NULL) {
203 >        if ((ffname = getpath(fname, getrlibpath(), R_OK)) == NULL) {
204                  sprintf(errmsg, "cannot find function file \"%s\"", fname);
205                  error(USER, errmsg);
206          }
# 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