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.12 by greg, Thu Apr 14 04:50:29 1994 UTC vs.
Revision 2.13 by greg, Thu Nov 2 17:38:05 1995 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1995 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 251 | Line 251 | double
251   chanvalue(n)                    /* return channel n to calcomp */
252   register int  n;
253   {
254        double  sum;
255        register RAY  *r;
256
254          if (fray == NULL)
255                  syntax("ray parameter used in constant expression");
256  
# Line 281 | Line 278 | register int  n;
278                                  fray->rop[2]*funcxf.xfm[2][n-6] +
279                                               funcxf.xfm[3][n-6] );
280  
281 <        if (n == 9) {                   /* total distance */
282 <                sum = fray->rot;
286 <                for (r = fray->parent; r != NULL; r = r->parent)
287 <                        sum += r->rot;
288 <                return(sum * funcxf.sca);
281 >        if (n == 9)                     /* total distance */
282 >                return(raydist(fray,PRIMARY) * funcxf.sca);
283  
290        }
291
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 309 | Line 301 | register int  n;
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;
314 <                for (r = fray->parent; r != NULL && r->crtype&SHADOW;
315 <                                r = r->parent)
316 <                        sum += r->rot;
317 <                return(sum * funcxf.sca);
318 <        }
304 >        if (n == 24)                    /* single ray (shadow) distance */
305 >                return((fray->rot+raydist(fray->parent,SHADOW)) * funcxf.sca);
306   badchan:
307          error(USER, "illegal channel number");
308   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines