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

Comparing ray/src/rt/srcobstr.c (file contents):
Revision 2.7 by greg, Wed Sep 8 06:07:52 2004 UTC vs.
Revision 2.9 by greg, Fri Sep 10 16:05:07 2004 UTC

# Line 50 | Line 50 | castshadow(int sn, FVECT rorg, FVECT rdir)
50   }
51  
52  
53 < static void                             /* initialize occlusion cache */
53 > void                                    /* initialize occlusion cache */
54   initobscache(int sn)
55   {
56          register SRCREC *srcp = &source[sn];
# Line 60 | Line 60 | initobscache(int sn)
60          int             i, j, k;
61          int             ax, ax1, ax2;
62  
63 +        if (srcp->sflags & (SSKIP|SPROX|SSPOT|SVIRTUAL))
64 +                return;                 /* don't cache these */
65          if (srcp->sflags & SDISTANT)
66                  cachelen = 4*SHADCACHE*SHADCACHE;
67          else if (srcp->sflags & SFLAT)
# Line 67 | Line 69 | initobscache(int sn)
69          else /* spherical distribution */
70                  cachelen = SHADCACHE*SHADCACHE*6;
71                                          /* allocate cache */
70        DCHECK(srcp->obscache != NULL,
71                        CONSISTENCY, "initobscache() called twice");
72          srcp->obscache = (OBSCACHE *)malloc(sizeof(OBSCACHE) +
73                                                  sizeof(OBJECT)*(cachelen-1));
74          if (srcp->obscache == NULL)
# Line 309 | Line 309 | srcblocked(RAY *r)
309          if (obs == OVOID)
310                  return(0);
311          op = objptr(obs);               /* check for intersection */
312 <        return((*ofun[op->otype].funp)(op, r));
312 >        if (!(*ofun[op->otype].funp)(op, r))
313 >                return(0);
314 >        op = source[r->rsrc].so;        /* check source really obstructed */
315 >        if ((*ofun[op->otype].funp)(op, r)) {
316 >                rayclear(r);            /* actually, source in front! */
317 >                return(0);
318 >        }
319 >        return(1);                      /* source truly blocked */
320   }
321  
322  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines