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

Comparing ray/src/rt/m_mirror.c (file contents):
Revision 1.1 by greg, Thu Jun 20 13:44:35 1991 UTC vs.
Revision 1.2 by greg, Tue Jul 16 15:56:46 1991 UTC

# Line 64 | Line 64 | register RAY  *r;
64                  for (i = 0; i < 3; i++)
65                          nr.rdir[i] = r->rdir[i] + 2.*r->rod*r->ron[i];
66                                          /* source we're aiming for next */
67 <                nr.rsrc = source[r->rsrc].sa.svnext;
67 >                nr.rsrc = source[r->rsrc].sa.sv.sn;
68          } else {                                /* ordinary reflection */
69                  FVECT  pnorm;
70                  double  pdot;
# Line 84 | Line 84 | register RAY  *r;
84   mir_proj(pm, o, s, n)           /* compute a mirror's projection */
85   MAT4  pm;
86   register OBJREC  *o;
87 < register SRCREC  *s;
87 > SRCREC  *s;
88   int  n;
89   {
90          FVECT  nv;
91          double  od;
92                                  /* get surface normal and offset */
93 <        if (sfun[o->otype].of->getpleq == NULL)
94 <                return(0);              /* reject non-planar case */
95 <        od = (*sfun[o->otype].of->getpleq)(nv, o);
93 >        od = getplaneq(nv, o);
94                                  /* check for behind */
95          if (DOT(s->sloc, nv) <= (s->sflags & SDISTANT ? FTINY : od+FTINY))
96                  return(0);
# Line 110 | Line 108 | double  offs;
108          register int  i, j;
109                                          /* assign matrix */
110          setident4(m);
111 <        for (i = 0; i < 3; i++)
112 <                for (j = 0; j < 3; j++)
111 >        for (j = 0; j < 3; j++) {
112 >                for (i = 0; i < 3; i++)
113                          m[i][j] -= 2.*nv[i]*nv[j];
116        for (j = 0; j < 3; j++)
114                  m[3][j] = 2.*offs*nv[j];
115 +        }
116   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines