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

Comparing ray/src/rt/m_direct.c (file contents):
Revision 2.7 by greg, Fri Apr 12 16:49:39 1996 UTC vs.
Revision 2.10 by greg, Wed Mar 5 16:16:53 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1994 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Routines for light-redirecting materials and
6   *   their associated virtual light sources
7   */
8  
9 + #include "copyright.h"
10 +
11   #include  "ray.h"
12  
13   #include  "otypes.h"
# Line 32 | Line 31 | static char SCCSid[] = "$SunId$ LBL";
31   */
32  
33  
34 < int  dir_proj();
34 > static int  dir_proj();
35 >
36   VSMATERIAL  direct1_vs = {dir_proj, 1};
37   VSMATERIAL  direct2_vs = {dir_proj, 2};
38  
# Line 41 | Line 41 | VSMATERIAL  direct2_vs = {dir_proj, 2};
41                                  getfunc(m, 8, 0xff, 1) )
42  
43  
44 + int
45   m_direct(m, r)                  /* shade redirected ray */
46   register OBJREC  *m;
47   register RAY  *r;
# Line 60 | Line 61 | register RAY  *r;
61   }
62  
63  
64 + int
65   redirect(m, r, n)               /* compute n'th ray redirection */
66   OBJREC  *m;
67   RAY  *r;
# Line 98 | Line 100 | int  n;
100          errno = 0;
101          va = mf->ep + 4*n;
102          coef = evalue(va[0]);
103 <        if (errno)
103 >        if (errno == EDOM || errno == ERANGE)
104                  goto computerr;
105          if (coef <= FTINY || rayorigin(&nr, r, TRANS, coef) < 0)
106                  return(0);
107          va++;                           /* compute direction */
108          for (j = 0; j < 3; j++) {
109                  nr.rdir[j] = evalue(va[j]);
110 <                if (errno)
110 >                if (errno == EDOM || errno == ERANGE)
111                          goto computerr;
112          }
113          if (mf->f != &unitxf)
# Line 129 | Line 131 | computerr:
131   }
132  
133  
134 + static int
135   dir_proj(pm, o, s, n)           /* compute a director's projection */
136   MAT4  pm;
137   OBJREC  *o;
# Line 175 | Line 178 | int  n;
178          errno = 0;
179          va = mf->ep + 4*n;
180          coef = evalue(va[0]);
181 <        if (errno)
181 >        if (errno == EDOM || errno == ERANGE)
182                  goto computerr;
183          if (coef <= FTINY)
184                  return(0);              /* insignificant */
185          va++;
186          for (i = 0; i < 3; i++) {
187                  newdir[i] = evalue(va[i]);
188 <                if (errno)
188 >                if (errno == EDOM || errno == ERANGE)
189                          goto computerr;
190          }
191          if (mf->f != &unitxf)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines