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.15 by greg, Sat Jan 25 18:27:39 2014 UTC vs.
Revision 2.16 by greg, Sat May 10 17:43:01 2014 UTC

# Line 29 | Line 29 | static void mirrorproj(MAT4  m, FVECT  nv, double  off
29   VSMATERIAL  mirror_vs = {mir_proj, 1};
30  
31  
32 < extern int
32 > int
33   m_mirror(                       /* shade mirrored ray */
34 <        register OBJREC  *m,
35 <        register RAY  *r
34 >        OBJREC  *m,
35 >        RAY  *r
36   )
37   {
38          COLOR  mcolor;
39          RAY  nr;
40          int  rpure = 1;
41 <        register int  i;
41 >        int  i;
42                                          /* check arguments */
43          if (m->oargs.nfargs != 3 || m->oargs.nsargs > 1)
44                  objerror(m, USER, "bad number of arguments");
# Line 82 | Line 82 | m_mirror(                      /* shade mirrored ray */
82  
83                  if (rayorigin(&nr, REFLECTED, r, mcolor) < 0)
84                          return(1);
85 <                if (DOT(r->pert,r->pert) > FTINY*FTINY) {
85 >                if (!(r->crtype & AMBIENT) &&
86 >                                DOT(r->pert,r->pert) > FTINY*FTINY) {
87                          pdot = raynormal(pnorm, r);     /* use textures */
88                          for (i = 0; i < 3; i++)
89                                  nr.rdir[i] = r->rdir[i] + 2.*pdot*pnorm[i];
# Line 106 | Line 107 | m_mirror(                      /* shade mirrored ray */
107   static int
108   mir_proj(               /* compute a mirror's projection */
109          MAT4  pm,
110 <        register OBJREC  *o,
110 >        OBJREC  *o,
111          SRCREC  *s,
112          int  n
113   )
# Line 142 | Line 143 | mir_proj(              /* compute a mirror's projection */
143  
144   static void
145   mirrorproj(             /* get mirror projection for surface */
146 <        register MAT4  m,
146 >        MAT4  m,
147          FVECT  nv,
148          double  offs
149   )
150   {
151 <        register int  i, j;
151 >        int  i, j;
152                                          /* assign matrix */
153          setident4(m);
154          for (j = 0; j < 3; j++) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines