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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 1.10 by greg, Tue Jun 26 09:00:15 1990 UTC vs.
Revision 1.11 by greg, Sat Aug 18 10:34:47 1990 UTC

# Line 26 | Line 26 | static char SCCSid[] = "$SunId$ LBL";
26  
27   #include  "ray.h"
28  
29 + #include  "octree.h"
30 +
31   #include  "otypes.h"
32  
33   int  inform = 'a';                      /* input format */
# Line 57 | Line 59 | static int  oputo(), oputd(), oputv(), oputl(),
59                  oputp(), oputn(), oputs(), oputw(), oputm();
60  
61   static int  (*ray_out[10])(), (*every_out[10])();
62 + static int  castonly;
63  
64   static int  puta(), putf(), putd();
65  
# Line 126 | Line 129 | register char  *vs;
129          extern int  ourtrace(), (*trace)();
130          register int (**table)() = ray_out;
131  
132 +        castonly = 1;
133          while (*vs)
134                  switch (*vs++) {
135                  case 't':                               /* trace */
136                          *table = NULL;
137                          table = every_out;
138                          trace = ourtrace;
139 +                        castonly = 0;
140                          break;
141                  case 'o':                               /* origin */
142                          *table++ = oputo;
# Line 141 | Line 146 | register char  *vs;
146                          break;
147                  case 'v':                               /* value */
148                          *table++ = oputv;
149 +                        castonly = 0;
150                          break;
151                  case 'l':                               /* length */
152                          *table++ = oputl;
153 +                        castonly = 0;
154                          break;
155                  case 'p':                               /* point */
156                          *table++ = oputp;
# Line 173 | Line 180 | FVECT  org, dir;
180          VCOPY(thisray.rorg, org);
181          VCOPY(thisray.rdir, dir);
182          rayorigin(&thisray, NULL, PRIMARY, 1.0);
183 <        rayvalue(&thisray);
183 >        if (castonly)
184 >                localhit(&thisray, &thescene) || sourcehit(&thisray);
185 >        else
186 >                rayvalue(&thisray);
187  
188          if (ray_out[0] == NULL)
189                  return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines