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

Comparing ray/src/rt/virtuals.c (file contents):
Revision 1.18 by greg, Wed Jul 17 12:38:52 1991 UTC vs.
Revision 1.19 by greg, Tue Jul 30 18:23:45 1991 UTC

# Line 140 | Line 140 | MAT4  pm;
140                  ourspot.siz = PI*maxrad2;
141                  ourspot.flen = 0.;
142                  if (source[sn].sflags & SSPOT) {
143                        copystruct(&theirspot, source[sn].sl.s);
143                          multp3(theirspot.aim, source[sn].sl.s->aim, pm);
144 +                        d = sqrt(dist2(ourspot.aim, theirspot.aim));
145 +                        d = sqrt(source[sn].sl.s->siz/PI) + d*source[sn].ss;
146 +                        theirspot.siz = PI*d*d;
147 +                        ourspot.flen = theirspot.flen = source[sn].sl.s->flen;
148                          d = ourspot.siz;
149                          if (!commonbeam(&ourspot, &theirspot, nsloc))
150                                  return(-1);     /* no overlap */
# Line 164 | Line 167 | MAT4  pm;
167                  if (source[sn].sflags & SPROX && d > source[sn].sl.prox)
168                          return(-1);             /* too far away */
169                  ourspot.flen = 0.;
170 <                if (d*d > maxrad2)
171 <                        ourspot.siz = 2.*PI*(1. - sqrt(1.-maxrad2/(d*d)));
170 >                d = (sqrt(maxrad2) + source[sn].ss) / d;
171 >                if (d < 1.-FTINY)
172 >                        ourspot.siz = 2.*PI*(1. - sqrt(1.-d*d));
173                  else
174                          nsflags &= ~SSPOT;
175                  if (source[sn].sflags & SSPOT) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines