ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/mgflib/parser.h
(Generate patch)

Comparing ray/src/cv/mgflib/parser.h (file contents):
Revision 1.2 by greg, Wed Jun 22 15:33:42 1994 UTC vs.
Revision 1.3 by greg, Wed Jun 22 17:15:46 1994 UTC

# Line 141 | Line 141 | extern int isflt(char *);              /* non-zero if floating poi
141   *      Definitions for 3-d vector manipulation functions
142   */
143  
144 < #ifdef SMLFLT
145 < #define FLOAT   float
144 > #ifdef  SMLFLT
145 > #define  FLOAT          float
146 > #define  FTINY          (1e-3)
147   #else
148 < #define FLOAT   double
148 > #define  FLOAT          double
149 > #define  FTINY          (1e-6)
150   #endif
151 + #define  FHUGE          (1e10)
152  
153   typedef FLOAT  FVECT[3];
154  
155 + #define  VCOPY(v1,v2)   ((v1)[0]=(v2)[0],(v1)[1]=(v2)[1],(v1)[2]=(v2)[2])
156 + #define  DOT(v1,v2)     ((v1)[0]*(v2)[0]+(v1)[1]*(v2)[1]+(v1)[2]*(v2)[2])
157 + #define  VSUM(vr,v1,v2,f)       ((vr)[0]=(v1)[0]+(f)*(v2)[0], \
158 +                                (vr)[1]=(v1)[1]+(f)*(v2)[1], \
159 +                                (vr)[2]=(v1)[2]+(f)*(v2)[2])
160 +
161 + #define is0vect(v)      (DOT(v,v) < FTINY*FTINY)
162 +
163 + #define round0(x)       if (x <= FTINY && x >= -FTINY) x = 0
164 +
165   #ifdef NOPROTO
166   extern double   normalize();            /* normalize a vector */
167   #else
# Line 184 | Line 197 | typedef struct {
197   typedef struct {
198          FVECT   p, n;           /* point and normal */
199   } C_VERTEX;             /* vertex context */
200 +
201 + #define isgrey(cxy)     ((cxy)->cx > .31 && (cxy)->cx < .35 && \
202 +                        (cxy)->cy > .31 && (cxy)->cy < .35)
203  
204   #define C_DEFCOLOR      {.333,.333}
205   #define C_DEFMATERIAL   {NULL,1,0.,C_DEFCOLOR,0.,C_DEFCOLOR,0.,C_DEFCOLOR,\

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines