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.8 by greg, Sat Dec 15 15:03:30 1990 UTC vs.
Revision 1.10 by greg, Mon Jun 17 08:26:20 1991 UTC

# 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 >        extern long  raynum;
23          RAY  rcont;
24          register INSTANCE  *in;
25          register int  i;
# Line 28 | Line 28 | register RAY  *r;
28                                          /* copy old ray */
29          copystruct(&rcont, r);
30                                          /* transform it */
31 <        rcont.rno = nrays;
31 >        rcont.rno = raynum++;
32          rcont.ro = NULL;
33          rcont.rot = FHUGE;
34          multp3(rcont.rorg, r->rorg, in->x.b.xfm);
# Line 46 | Line 46 | register RAY  *r;
46                  r->rox = NULL;
47          } else {                        /* else use theirs */
48                  r->ro = rcont.ro;
49                newrayxf(r);            /* allocate transformation */
50                                /* NOTE: r->rox may equal rcont.rox! */
49                  if (rcont.rox != NULL) {
50 +                        newrayxf(r);            /* allocate transformation */
51 +                                        /* NOTE: r->rox may equal rcont.rox! */
52                          multmat4(r->rox->f.xfm, rcont.rox->f.xfm, in->x.f.xfm);
53                          r->rox->f.sca = rcont.rox->f.sca * in->x.f.sca;
54                          multmat4(r->rox->b.xfm, in->x.b.xfm, rcont.rox->b.xfm);
55                          r->rox->b.sca = in->x.b.sca * rcont.rox->b.sca;
56                  } else
57 <                        copystruct(r->rox, &in->x);
57 >                        r->rox = &in->x;
58          }
59                                          /* transform it back */
60          r->rot = rcont.rot * in->x.f.sca;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines