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

Comparing ray/src/rt/o_instance.c (file contents):
Revision 1.9 by greg, Sat Dec 15 16:43:58 1990 UTC vs.
Revision 2.3 by greg, Tue Dec 20 20:18:19 1994 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1990 Regents of the University of California */
1 > /* Copyright (c) 1994 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 19 | Line 19 | o_instance(o, r)               /* compute ray intersection with oct
19   OBJREC  *o;
20   register RAY  *r;
21   {
22        extern long  nrays;
22          RAY  rcont;
23          register INSTANCE  *in;
24          register int  i;
25                                          /* get the octree */
26          in = getinstance(o, IO_ALL);
27 <                                        /* copy old ray */
27 >                                        /* copy and transform ray */
28          copystruct(&rcont, r);
30                                        /* transform it */
31        rcont.rno = nrays;
32        rcont.ro = NULL;
33        rcont.rot = FHUGE;
29          multp3(rcont.rorg, r->rorg, in->x.b.xfm);
30          multv3(rcont.rdir, r->rdir, in->x.b.xfm);
31          for (i = 0; i < 3; i++)
32                  rcont.rdir[i] /= in->x.b.sca;
33 <                                        /* trace it */
33 >        rcont.rmax *= in->x.b.sca;
34 >                                        /* clear and trace it */
35 >        rayclear(&rcont);
36          if (!localhit(&rcont, &in->obj->scube))
37 <                return(0);              /* missed */
37 >                return(0);                      /* missed */
38          if (rcont.rot * in->x.f.sca >= r->rot)
39 <                return(0);              /* not close enough */
39 >                return(0);                      /* not close enough */
40  
41          if (o->omod != OVOID) {         /* if we have modifier, use it */
42                  r->ro = o;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines