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.5 by greg, Wed Feb 5 09:23:38 1992 UTC vs.
Revision 2.6 by greg, Tue Mar 3 13:58:12 1992 UTC

# Line 59 | Line 59 | int  dofwd;
59                  scompile("Dx=$1;Dy=$2;Dz=$3;", NULL, 0);
60                  scompile("Nx=$4;Ny=$5;Nz=$6;", NULL, 0);
61                  scompile("Px=$7;Py=$8;Pz=$9;", NULL, 0);
62 <                scompile("T=$10;Rdot=$11;", NULL, 0);
62 >                scompile("T=$10;Ts=$25;Rdot=$11;", NULL, 0);
63                  scompile("S=$12;Tx=$13;Ty=$14;Tz=$15;", NULL, 0);
64                  scompile("Ix=$16;Iy=$17;Iz=$18;", NULL, 0);
65                  scompile("Jx=$19;Jy=$20;Jz=$21;", NULL, 0);
# Line 273 | Line 273 | register int  n;
273                                  fray->rop[2]*funcxf.xfm[2][n-6] +
274                                               funcxf.xfm[3][n-6] );
275  
276 <        if (n == 9) {                   /* distance */
277 <
276 >        if (n == 9) {                   /* total distance */
277                  sum = fray->rot;
278                  for (r = fray->parent; r != NULL; r = r->parent)
279                          sum += r->rot;
280                  return(sum * funcxf.sca);
281  
282          }
283 +
284          if (n == 10)                    /* dot product (range [-1,1]) */
285                  return( fray->rod <= -1.0 ? -1.0 :
286                          fray->rod >= 1.0 ? 1.0 :
# Line 300 | Line 300 | register int  n;
300  
301          if (n < 24)                     /* k unit vector */
302                  return(funcxf.xfm[2][n-21] / funcxf.sca);
303 +
304 +        if (n == 24) {                  /* single ray (shadow) distance */
305 +                sum = fray->rot;
306 +                for (r = fray->parent; r != NULL && r->crtype&SHADOW;
307 +                                r = r->parent)
308 +                        sum += r->rot;
309 +                return(sum * funcxf.sca);
310 +        }
311   badchan:
312          error(USER, "illegal channel number");
313   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines