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

Comparing ray/src/rt/source.c (file contents):
Revision 1.26 by greg, Sat Dec 15 15:03:34 1990 UTC vs.
Revision 1.27 by greg, Mon Dec 17 14:38:12 1990 UTC

# Line 237 | Line 237 | register int  sn;              /* source number */
237                                                  /* domega constant */
238                  return(source[sn].ss2);
239  
240        else {
240                                                  /* check proximity */
241 <                if (source[sn].sflags & SPROX &&
242 <                                d > source[sn].sl.prox)
243 <                        return(0.0);
244 <
245 <                if (norm != NULL)
246 <                        ddot /= d;
247 <                else
248 <                        ddot = 1.0;
241 >        if (source[sn].sflags & SPROX &&
242 >                        d > source[sn].sl.prox)
243 >                return(0.0);
244 >                                                /* compute dot product */
245 >        if (norm != NULL)
246 >                ddot /= d;
247 >        else
248 >                ddot = 1.0;
249                                                  /* check angle */
250 <                if (source[sn].sflags & SSPOT) {
251 <                        if (source[sn].sl.s->siz < 2.0*PI *
250 >        if (source[sn].sflags & SSPOT) {
251 >                if (source[sn].sl.s->siz < 2.0*PI *
252                                  (1.0 + DOT(source[sn].sl.s->aim,sr->rdir)))
253 <                                return(0.0);
254 <                        d += source[sn].sl.s->flen;
256 <                }
257 <                                                /* return domega */
258 <                return(ddot*source[sn].ss2/(d*d));
253 >                        return(0.0);
254 >                d += source[sn].sl.s->flen;     /* adjust length */
255          }
256 +                                                /* compute domega */
257 +        return(ddot*source[sn].ss2/(d*d));
258   }
259  
260  
# Line 376 | Line 374 | char  *p;                      /* data for f */
374          for (sn = 0; sn < ncnts; sn++) {
375                                                  /* check threshold */
376                  if ((sn+nshadcheck>=ncnts ? cntord[sn].brt :
377 <                                cntord[sn].brt-cntord[sn+nshadcheck].brt) <
378 <                                ourthresh*bright(r->rcol))
377 >                                cntord[sn].brt-cntord[sn+nshadcheck].brt)
378 >                                < ourthresh*bright(r->rcol))
379                          break;
380                                                  /* get statistics */
381                  hwt = (double)source[cntord[sn].sno].nhits /

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines