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 1.11 by greg, Sat Aug 18 04:25:59 1990 UTC vs.
Revision 1.12 by greg, Sat Dec 15 15:03:32 1990 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1990 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 56 | Line 56 | double  rw;
56          r->newcset = r->clipset;
57          r->ro = NULL;
58          r->rot = FHUGE;
59 +        r->rox = NULL;
60          r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
61          setcolor(r->pcol, 1.0, 1.0, 1.0);
62          setcolor(r->rcol, 0.0, 0.0, 0.0);
# Line 230 | Line 231 | register RAY  *r;
231                  newdot = -newdot;
232          }
233          return(newdot);
234 + }
235 +
236 +
237 + newrayxf(r)                     /* get new tranformation matrix for ray */
238 + RAY  *r;
239 + {
240 +        static struct xfn {
241 +                struct xfn  *next;
242 +                FULLXF  xf;
243 +        }  xfseed = { &xfseed }, *xflast = &xfseed;
244 +        register struct xfn  *xp;
245 +        register RAY  *rp;
246 +
247 +        /*
248 +         * Search for transform in circular list that
249 +         * has no associated ray in the tree.
250 +         */
251 +        xp = xflast;
252 +        for (rp = r->parent; rp != NULL; rp = rp->parent)
253 +                if (rp->rox == &xp->xf) {               /* xp in use */
254 +                        xp = xp->next;                  /* move to next */
255 +                        if (xp == xflast) {             /* need new one */
256 +                                xp = (struct xfn *)malloc(sizeof(struct xfn));
257 +                                if (xp == NULL)
258 +                                        error(SYSTEM,
259 +                                                "out of memory in newrayxf");
260 +                                                        /* insert in list */
261 +                                xp->next = xflast->next;
262 +                                xflast->next = xp;
263 +                                break;                  /* we're done */
264 +                        }
265 +                        rp = r;                 /* start check over */
266 +                }
267 +                                        /* got it */
268 +        r->rox = &xp->xf;
269 +        xflast = xp;
270   }
271  
272  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines