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.11 by gwlarson, Thu Jun 10 15:22:23 1999 UTC vs.
Revision 3.13 by schorsch, Mon Jul 14 22:24:00 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1998 Silicon Graphics, Inc. */
2 <
3 < /* SCCSid "$SunId$ SGI" */
4 <
1 > /* RCSid: $Id$ */
2   /*
3   *  sm_geom.h
4   */
5  
6   /* Assumes included after standard.h  */
7 + #ifndef _RAD_SM_GEOM_H_
8 + #define _RAD_SM_GEOM_H_
9  
10   #include <values.h>
11  
12 + #ifdef __cplusplus
13 + extern "C" {
14 + #endif
15 +
16 + #ifdef SMLFLT
17 + #define EQUALITY_EPS 1e-6
18 + #else
19 + #define EQUALITY_EPS 1e-10
20 + #endif
21 +
22   #define F_TINY 1e-10
23   #define FZERO(x) ((x) < F_TINY && (x) > -F_TINY)
24   #define FEQUAL(a,b) FZERO((a) - (b))
# Line 36 | Line 45 | typedef struct _FPEQ {
45    
46   typedef long BCOORD;
47   typedef long BDIR;
39 typedef long TINT;
48  
49   #define BITS_BCOORD     (BITS(long)-2)
50   #define SHIFT_MAXBCOORD (BITS_BCOORD-1)  
# Line 49 | Line 57 | typedef long TINT;
57   #ifndef INVALID
58   #define INVALID -1
59   #endif
52
53 #define GT_INVALID  0
54 #define GT_VERTEX   1
55 #define GT_EDGE     2
56 #define GT_FACE     4
57 #define GT_INTERIOR 8
58 #define GT_INTERSECT 16
59 #define GT_ADJACENT  32
60 #define GT_OUT       64
61
60   #define IADDV3(v,a)  ((v)[0] += (a)[0],(v)[1] += (a)[1],(v)[2] += (a)[2])
61   #define ISUBV3(v,a)  ((v)[0] -= (a)[0],(v)[1] -= (a)[1],(v)[2] -= (a)[2])
62   #define ISCALEV3(v,a)  ((v)[0] *= (a),(v)[1] *= (a),(v)[2] *= (a))
# Line 96 | Line 94 | typedef long TINT;
94   #define MIN_VEC3(v) ((v)[0]<(v)[1]?((v)[0]<(v)[2]?(v)[0]:v[2]): \
95                       (v)[1]<(v)[2]?(v)[1]:(v)[2])
96   #define MAX3(a,b,c) (((b)>(a))?((b) > (c))?(b):(c):((a)>(c))?(a):(c))  
97 < #define MIN3(a,b,c) (((b)<(a))?((b) < (c))?(b):(c):((a)<(c))?(a):(c))                      
97 > #define MIN3(a,b,c) (((b)<(a))?((b) < (c))?(b):(c):((a)<(c))?(a):(c))
98 >
99   #define MAX(a,b)    (((b)>(a))?(b):(a))  
100   #define MIN(a,b)  (((b)<(a))?(b):(a))  
101  
# Line 106 | Line 105 | typedef long TINT;
105   #define NTH_BIT(n,i)         ((n) & (1<<(i)))
106   #define SET_NTH_BIT(n,i)     ((n) |= (1<<(i)))  
107  
108 + #define PT_ON_PLANE(p,peq) (DOT(FP_N(peq),p)+FP_D(peq))
109  
110 < /* int convex_angle(FVECT v0,FVECT v1,FVECT v2) */
111 < /* void triangle_centroid(FVECT v0,FVECT v1,FVECT v2,FVECT c) */
112 < /* void triangle_plane_equation(FVECT v0,FVECT v1,FVECT v2,FVECT n,double *nd,
113 <        char norm) */
114 < /* int vec3_equal(FVECT v1,v2) */
115 < /* int point_relative_to_plane(FVECT p,FVECT n, double nd) */
116 < /* int point_in_circle(FVECT p,FVECT p0,FVECT p1) */
117 < /* int intersect_line_plane(FVECT r,FVECT p1,FVECT p2,float *plane) */
118 < /* int point_in_cone(FVECT p,FVECT p1,FVECT p2,FVECT p3,FVECT p4) */  
119 < /* void point_on_sphere(FVECT ps,FVECT p,FVECT c) */
120 < /* int test_point_against_spherical_tri(FVECT v0,FVECT v1,FVECT v2,FVECT p,
121 <       FVECT n,char *nset,char *which,char sides[3]) */
122 < /* int test_single_point_against_spherical_tri(FVECT v0,FVECT v1,FVECT v2,
123 <       FVECT p,char *which )*/
124 < /* int test_vertices_for_tri_inclusion(FVECT tri[3],FVECT pts[3],char *nset,
125 <       FVECT n[3],FVECT avg,char pt_sides[3][3]); */
126 < /* void set_sidedness_tests(FVECT tri[3],FVECT pts[3],char test[3],
127 <        char sides[3][3],char nset,FVECT n[3])
128 < */
129 < /* int cs_spherical_edge_edge_test(FVECT n[2][3],int i,int j,FVECT avg[2]) */
130 < /* int spherical_tri_tri_intersect(FVECT a1,FVECT a2,FVECT a3,
131 <                                 FVECT b1,FVECT b2,FVECT b3) */
132 <  
133 < /* void calculate_view_frustum(FVECT vp,hv,vv,double horiz,vert,near,far,
134 <   FVECT fnear[4],FVECT ffar[4])
135 < */
136 < /* double triangle_normal_Newell(FVECT v0,FVECT v1,FVECT v2,FVECT n,char n)*/
110 > /* FUNCTIONS:
111 >   int point_in_cone(FVECT p,a,b,c)
112 >   void triangle_centroid(FVECT v0,v1,v2,c)
113 >   double tri_normal(FVECT v0,v1,v2,n,int norm)
114 >   void tri_plane_equation(FVECT v0,v1,v2,FPEQ *peqptr,int norm)
115 >   int intersect_ray_plane(FVECT orig,dir,FPEQ peq,double *pd,FVECT r)
116 >   double point_on_sphere(FVECT ps,p,c)
117 >   int point_in_stri(FVECT v0,v1,v2,p)
118 >   int ray_intersect_tri(FVECT orig,dir,v0,v1,v2,pt)
119 >   void calculate_view_frustum(FVECT vp,hv,vv,double horiz,vert,near,far,
120 >                               FVECT fnear[4],ffar[4])
121 >   void bary2d(double x1,y1,x2,y2,x3,y3,px,py,coord)
122 > */
123   double tri_normal();
138 /* double spherical_edge_normal(FVECT v0,FVECT v1,FVECT n,char norm) */
139 double spherical_edge_normal();
124   double point_on_sphere();
125  
142 #define point_in_stri_n(n0,n1,n2,p) \
143  ((DOT(n0,p)<=FTINY)&&(DOT(n1,p)<=FTINY)&&(DOT(n2,p)<=FTINY))
126  
127 < #define PT_ON_PLANE(p,peq) (DOT(FP_N(peq),p)+FP_D(peq))
127 > #ifdef __cplusplus
128 > }
129 > #endif
130 > #endif /* _RAD_SM_GEOM_H_ */
131  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines