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

Comparing ray/src/rt/raytrace.c (file contents):
Revision 2.15 by greg, Mon Feb 28 08:54:02 1994 UTC vs.
Revision 2.16 by greg, Tue Dec 20 20:18:22 1994 UTC

# Line 34 | Line 34 | OBJREC  Lamb = {
34          {0, 5, NULL, Lambfa}, NULL,
35   };                                      /* a Lambertian surface */
36  
37 + static OBJREC  Aftplane;                /* aft clipping plane object */
38 +
39   static int  raymove(), checkset(), checkhit();
40  
41   #define  MAXLOOP        128             /* modifier loop detection */
# Line 67 | Line 69 | double  rw;
69                  r->rweight = ro->rweight * rw;
70                  r->crtype = ro->crtype | (r->rtype = rt);
71                  VCOPY(r->rorg, ro->rop);
72 +                r->rmax = 0.0;
73          }
74          rayclear(r);
75          return(r->rlvl <= maxdepth && r->rweight >= minweight ? 0 : -1);
# Line 78 | Line 81 | register RAY  *r;
81   {
82          r->rno = raynum++;
83          r->newcset = r->clipset;
84 <        r->ro = NULL;
85 <        r->rot = FHUGE;
84 >        if (r->rmax > FTINY) {
85 >                r->ro = &Aftplane;
86 >                r->rot = r->rmax;
87 >                r->rop[0] = r->rorg[0] + r->rot*r->rdir[0];
88 >                r->rop[1] = r->rorg[1] + r->rot*r->rdir[1];
89 >                r->rop[2] = r->rorg[2] + r->rot*r->rdir[2];
90 >        } else {
91 >                r->ro = NULL;
92 >                r->rot = FHUGE;
93 >        }
94          r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
95          setcolor(r->pcol, 1.0, 1.0, 1.0);
96          setcolor(r->rcol, 0.0, 0.0, 0.0);
# Line 95 | Line 106 | RAY  *r;
106  
107          if (localhit(r, &thescene))
108                  gotmat = raycont(r);
109 <        else if (sourcehit(r))
109 >        else if (r->ro == &Aftplane) {
110 >                r->ro = NULL;
111 >                r->rot = FHUGE;
112 >        } else if (sourcehit(r))
113                  gotmat = rayshade(r, r->ro->omod);
114  
115          if (r->ro != NULL && !gotmat)
# Line 378 | Line 392 | register CUBE  *scene;
392                          return(0);
393          }
394          cxset[0] = 0;
395 <        return(raymove(curpos, cxset, sflags, r, scene) == RAYHIT);
395 >        return(raymove(curpos, cxset, sflags, r, scene) == RAYHIT &&
396 >                        r->ro != &Aftplane);
397   }
398  
399  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines