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.19 by greg, Mon Jun 6 16:22:46 2016 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");
45                                          /* check for substitute material */
46                                          /* but avoid double-counting */
47 <        if (m->oargs.nsargs > 0 && !(r->crtype & (AMBIENT|SPECULAR)) &&
48 <                        (r->rsrc < 0 || source[r->rsrc].so != r->ro)) {
47 >        if ( m->oargs.nsargs > 0 &&
48 >                        (r->rsrc < 0 || source[r->rsrc].so != r->ro) &&
49 >                        !(r->crtype & (AMBIENT|SPECULAR) && r->rod > 0.) ) {
50                  if (!strcmp(m->oargs.sarg[0], VOIDID)) {
51                          raytrans(r);
52                          return(1);
# Line 82 | Line 83 | m_mirror(                      /* shade mirrored ray */
83  
84                  if (rayorigin(&nr, REFLECTED, r, mcolor) < 0)
85                          return(1);
86 <                if (DOT(r->pert,r->pert) > FTINY*FTINY) {
86 >                if (!(r->crtype & AMBIENT) &&
87 >                                DOT(r->pert,r->pert) > FTINY*FTINY) {
88                          pdot = raynormal(pnorm, r);     /* use textures */
89                          for (i = 0; i < 3; i++)
90                                  nr.rdir[i] = r->rdir[i] + 2.*pdot*pnorm[i];
# Line 106 | Line 108 | m_mirror(                      /* shade mirrored ray */
108   static int
109   mir_proj(               /* compute a mirror's projection */
110          MAT4  pm,
111 <        register OBJREC  *o,
111 >        OBJREC  *o,
112          SRCREC  *s,
113          int  n
114   )
# Line 142 | Line 144 | mir_proj(              /* compute a mirror's projection */
144  
145   static void
146   mirrorproj(             /* get mirror projection for surface */
147 <        register MAT4  m,
147 >        MAT4  m,
148          FVECT  nv,
149          double  offs
150   )
151   {
152 <        register int  i, j;
152 >        int  i, j;
153                                          /* assign matrix */
154          setident4(m);
155          for (j = 0; j < 3; j++) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines