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.14 by greg, Wed Dec 10 07:07:07 2008 UTC vs.
Revision 2.15 by greg, Wed Dec 10 17:33:23 2008 UTC

# Line 84 | Line 84 | nextsample:
84                          d = vpos[SW]*vpos[SW];
85                          if (d > trim[SW]) trim[SW] = d;
86                          trim[SU] += d;
87 <                        d = 1.0/0.7236;         /* correct sphsetsrc() */
88 <                        trim[SW] = trim[SV] = trim[SU] =
89 <                                        d*sqrt(trim[SW]/trim[SU]);
87 >                        if (trim[SU] > FTINY*FTINY) {
88 >                                d = 1.0/0.7236; /* correct sphsetsrc() */
89 >                                trim[SW] = trim[SV] = trim[SU] =
90 >                                                d*sqrt(trim[SW]/trim[SU]);
91 >                        } else
92 >                                trim[SW] = trim[SV] = trim[SU] = 0.0;
93                  }
94                  for (i = 0; i < 3; i++)
95                          vpos[i] *= trim[i];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines