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.26 by greg, Sat Jun 9 07:16:47 2012 UTC vs.
Revision 2.28 by greg, Tue May 19 11:49:05 2015 UTC

# Line 213 | Line 213 | worldfunc(                     /* special function context sans object *
213   )
214   {
215          static RNUMBER  lastrno = ~0;
216 +
217 +        if (rayinitcal[0])              /* initialize on first call */
218 +                initfunc();
219                                          /* set evaluator context */
220          setcontext(ctx);
221                                          /* check if ray already set */
# Line 302 | Line 305 | chanvalue(                     /* return channel n to calcomp */
305                                  fray->ron[2]*funcxf.xfm[2][n-3] )
306                           / funcxf.sca );
307  
308 <        if (n <= 8)                     /* intersection */
308 >        if (n <= 8) {                   /* intersection point */
309 >                if (fray->rot >= FHUGE)
310 >                        return(0.0);    /* XXX should be runtime error? */
311  
312                  return( fray->rop[0]*funcxf.xfm[0][n-6] +
313                                  fray->rop[1]*funcxf.xfm[1][n-6] +
314                                  fray->rop[2]*funcxf.xfm[2][n-6] +
315                                               funcxf.xfm[3][n-6] );
316 +        }
317  
318          if (n == 9)                     /* total distance */
319                  return(raydist(fray,PRIMARY) * funcxf.sca);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines