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

Comparing ray/src/rt/srcsamp.c (file contents):
Revision 2.3 by greg, Tue Jul 21 12:47:12 1992 UTC vs.
Revision 2.5 by greg, Mon Mar 8 12:37:39 1993 UTC

# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15   #include  "random.h"
16  
17  
18 + static int  cyl_partit(), flt_partit();
19 +
20 +
21   double
22   nextssamp(r, si)                /* compute sample for source, rtn. distance */
23   register RAY  *r;               /* origin is read, direction is set */
# Line 82 | Line 85 | nextsample:
85          si->dom  = source[si->sn].ss2;
86          if (source[si->sn].sflags & SFLAT) {
87                  si->dom *= sflatform(si->sn, r->rdir);
88 <                si->dom *= (double)(size[SU]*size[SV])/(MAXSPART*MAXSPART);
88 >                si->dom *= size[SU]*size[SV]/(MAXSPART*(double)MAXSPART);
89          } else if (source[si->sn].sflags & SCYL) {
90                  si->dom *= scylform(si->sn, r->rdir);
91 <                si->dom *= (double)size[SU]/MAXSPART;
91 >                si->dom *= size[SU]/(double)MAXSPART;
92          } else {
93 <                si->dom *= (double)(size[SU]*size[SV]*size[SW]) /
94 <                                (MAXSPART*MAXSPART*MAXSPART) ;
93 >                si->dom *= size[SU]*size[SV]*(double)size[SW] /
94 >                                (MAXSPART*MAXSPART*(double)MAXSPART) ;
95          }
96          if (source[si->sn].sflags & SDISTANT)
97                  return(FHUGE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines