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.14 by greg, Tue Feb 12 12:57:07 1991 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 230 | Line 230 | register RAY  *r;
230                  newdot = -newdot;
231          }
232          return(newdot);
233 + }
234 +
235 +
236 + newrayxf(r)                     /* get new tranformation matrix for ray */
237 + RAY  *r;
238 + {
239 +        static struct xfn {
240 +                struct xfn  *next;
241 +                FULLXF  xf;
242 +        }  xfseed = { &xfseed }, *xflast = &xfseed;
243 +        register struct xfn  *xp;
244 +        register RAY  *rp;
245 +
246 +        /*
247 +         * Search for transform in circular list that
248 +         * has no associated ray in the tree.
249 +         */
250 +        xp = xflast;
251 +        for (rp = r->parent; rp != NULL; rp = rp->parent)
252 +                if (rp->rox == &xp->xf) {               /* xp in use */
253 +                        xp = xp->next;                  /* move to next */
254 +                        if (xp == xflast) {             /* need new one */
255 +                                xp = (struct xfn *)bmalloc(sizeof(struct xfn));
256 +                                if (xp == NULL)
257 +                                        error(SYSTEM,
258 +                                                "out of memory in newrayxf");
259 +                                                        /* insert in list */
260 +                                xp->next = xflast->next;
261 +                                xflast->next = xp;
262 +                                break;                  /* we're done */
263 +                        }
264 +                        rp = r;                 /* start check over */
265 +                }
266 +                                        /* got it */
267 +        r->rox = &xp->xf;
268 +        xflast = xp;
269   }
270  
271  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines