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 2.20 by greg, Fri Sep 14 13:34:02 2012 UTC vs.
Revision 2.24 by greg, Mon Feb 1 16:19:49 2021 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11   #include "copyright.h"
12  
13   #include  "ray.h"
14
14   #include  "otypes.h"
15 <
15 > #include  "otspecial.h"
16   #include  "source.h"
18
17   #include  "random.h"
18  
19   #define  MINSAMPLES     16              /* minimum number of pretest samples */
# Line 141 | Line 139 | vsmaterial(                    /* get virtual source material pointer *
139          OBJREC  *m;
140  
141          i = o->omod;
142 <        m = findmaterial(objptr(i));
142 >        m = findmaterial(o);
143          if (m == NULL)
144                  return(objptr(i));
145          if (m->otype != MAT_ILLUM || m->oargs.nsargs < 1 ||
# Line 324 | Line 322 | vstestvis(             /* pretest source visibility */
322   {
323          RAY  sr;
324          FVECT  onorm;
325 <        FVECT  offsdir;
325 >        double  offsdir[3];
326          SRCINDEX  si;
327          double  or, d, d1;
328          int  stestlim, ssn;
# Line 340 | Line 338 | vstestvis(             /* pretest source visibility */
338                                          /* 32. == heuristic constant */
339                  n = 32.*or2/(thescene.cusize*thescene.cusize)*vspretest + .5;
340          } else {
341 <                for (i = 0; i < 3; i++)
344 <                        offsdir[i] = source[sn].sloc[i] - oc[i];
341 >                VSUB(offsdir, source[sn].sloc, oc);
342                  d = DOT(offsdir,offsdir);
343                  if (d <= FTINY)
344                          n = 2.*PI * vspretest + .5;
# Line 377 | Line 374 | vstestvis(             /* pretest source visibility */
374                                  sr.rorg[i] = oc[i] + offsdir[i] + d*onorm[i];
375                                  sr.rdir[i] = -onorm[i];
376                          }
377 +                        sr.rmax = 0.0;
378                          rayorigin(&sr, PRIMARY, NULL, NULL);
379                  } while (!(*ofun[o->otype].funp)(o, &sr));
380                                          /* check against source */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines