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 2.4 by greg, Wed Jul 26 16:53:25 1995 UTC vs.
Revision 2.5 by greg, Sat Aug 26 15:15:51 1995 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1995 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 97 | Line 97 | register OBJREC  *o;
97   SRCREC  *s;
98   int  n;
99   {
100 <        FVECT  nv;
100 >        FVECT  nv, sc;
101          double  od;
102 +        register int  i, j;
103                                  /* get surface normal and offset */
104          od = getplaneq(nv, o);
105 <                                /* check for behind */
106 <        if (DOT(s->sloc, nv) <= (s->sflags & SDISTANT ? FTINY : od+FTINY))
105 >                                /* check for extreme point for behind */
106 >        VCOPY(sc, s->sloc);
107 >        for (i = s->sflags & SFLAT ? SV : SW; i >= 0; i--)
108 >                if (DOT(nv, s->ss[i]) > 0.)
109 >                        for (j = 0; j < 3; j++)
110 >                                sc[j] += s->ss[i][j];
111 >                else
112 >                        for (j = 0; j < 3; j++)
113 >                                sc[j] -= s->ss[i][j];
114 >        if (DOT(sc, nv) <= (s->sflags & SDISTANT ? FTINY : od+FTINY))
115                  return(0);
116                                  /* everything OK -- compute projection */
117          mirrorproj(pm, nv, od);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines