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.35 by greg, Tue Feb 25 02:47:23 2003 UTC vs.
Revision 2.36 by greg, Tue Mar 4 19:02:22 2003 UTC

# Line 1 | Line 1
1   #ifndef lint
2 < static const char       RCSid[] = "$Id$";
2 > static const char RCSid[] = "$Id$";
3   #endif
4   /*
5   *  raytrace.c - routines for tracing and shading rays.
# Line 95 | Line 95 | register RAY  *r;
95   {
96          r->rno = raynum++;
97          r->newcset = r->clipset;
98 +        r->hitf = rayhit;
99          r->robj = OVOID;
100          r->ro = NULL;
101          r->rox = NULL;
# Line 409 | Line 410 | register RAY  *r;
410   }
411  
412  
413 + void
414 + rayhit(oset, r)                 /* standard ray hit test */
415 + OBJECT  *oset;
416 + RAY  *r;
417 + {
418 +        OBJREC  *o;
419 +        int     i;
420 +
421 +        for (i = oset[0]; i > 0; i--) {
422 +                o = objptr(oset[i]);
423 +                if ((*ofun[o->otype].funp)(o, r))
424 +                        r->robj = oset[i];
425 +        }
426 + }
427 +
428 +
429   int
430   localhit(r, scene)              /* check for hit in the octree */
431   register RAY  *r;
# Line 564 | Line 581 | CUBE  *cu;
581   OBJECT  *cxs;
582   {
583          OBJECT  oset[MAXSET+1];
567        register OBJREC  *o;
568        register int  i;
584  
585          objset(oset, cu->cutree);
586 <        checkset(oset, cxs);                    /* eliminate double-checking */
587 <        for (i = oset[0]; i > 0; i--) {
588 <                o = objptr(oset[i]);
589 <                if ((*ofun[o->otype].funp)(o, r))
590 <                        r->robj = oset[i];
576 <        }
577 <        if (r->ro == NULL)
586 >        checkset(oset, cxs);                    /* avoid double-checking */
587 >
588 >        (*r->hitf)(oset, r);                    /* test for hit in set */
589 >
590 >        if (r->robj == OVOID)
591                  return(0);                      /* no scores yet */
592  
593          return(incube(cu, r->rop));             /* hit OK if in current cube */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines