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

Comparing ray/src/hd/sm_geom.h (file contents):
Revision 3.5 by gwlarson, Tue Oct 6 18:16:54 1998 UTC vs.
Revision 3.6 by gwlarson, Wed Nov 11 12:05:39 1998 UTC

# Line 10 | Line 10
10  
11   #include <values.h>
12  
13 + #define F_TINY 1e-3
14 +
15 + #define FZERO(x) ((x) < F_TINY && (x) > -F_TINY)
16 + #define FEQUAL(a,b) FZERO((a) - (b))
17 +
18   #define ZERO(x) ((x) < FTINY && (x) > -FTINY)
19   #define EQUAL(a,b) ZERO((a) - (b))
20  
# Line 58 | Line 63 | typedef long TINT;
63  
64   #define ZERO_VEC3(v)     (ZERO(v[0]) && ZERO(v[1]) && ZERO(v[2]) )
65   #define EQUAL_VEC3(a,b)  (EQUAL(a[0],b[0])&&EQUAL(a[1],b[1])&&EQUAL(a[2],b[2]))
66 + #define FZERO_VEC3(v)     (FZERO(v[0]) && FZERO(v[1]) && FZERO(v[2]) )
67 + #define FEQUAL_VEC3(a,b) (FEQUAL(a[0],b[0])&&FEQUAL(a[1],b[1])&&FEQUAL(a[2],b[2]))
68   #define NEGATE_VEC3(v)   ((v)[0] *= -1.0,(v)[1] *= -1.0,(v)[2] *= -1.0)
69   #define COPY_VEC2(v1,v2) ((v1)[0]=(v2)[0],(v1)[1]=(v2)[1])
70   #define DIST(a,b)         (sqrt(((a)[0]-(b)[0])*((a)[0]-(b)[0]) + \
# Line 119 | Line 126 | double tri_normal();
126   double spherical_edge_normal();
127  
128   #define point_in_stri_n(n0,n1,n2,p) \
129 <                     ((DOT(n0,p)<=0.0)&&(DOT(n1,p)<=0.0)&&(DOT(n2,p)<=0.0))
129 >  ((DOT(n0,p)<=F_TINY)&&(DOT(n1,p)<=F_TINY)&&(DOT(n2,p)<=F_TINY))
130  
131   #define PT_ON_PLANE(p,peq) (DOT(FP_N(peq),p)+FP_D(peq))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines