--- ray/src/hd/sm_qtree.h 1998/09/16 18:16:29 3.6 +++ ray/src/hd/sm_qtree.h 1999/06/10 15:22:24 3.12 @@ -20,7 +20,15 @@ * < -1: it is an index to a set of objects */ #include "object.h" +typedef struct _FUNC { + int (*func)(); + int (*func_after)(); + int *argptr; +}FUNC; +#define F_FUNC(f) (f.func) +#define F_FUNC2(f) (f.func_after) +#define F_ARGS(f) (f.argptr) #define QUADTREE int #define EMPTY (-1) @@ -52,20 +60,19 @@ /* QUADTREE NODE FLAGS */ -#define QT_OFFSET(qt) ((qt)>>5) -#define QT_F_BIT(qt) ((qt)&0x1f) -#define QT_F_OP(f,qt,op) ((f)[QT_OFFSET(qt)] op (0x1< a?4:0) | (b1[0] > a?2:0) | (b2[0] > a?1:0)), \ + s1 = ((b0[1] > b?4:0) | (b1[1] > b?2:0) | (b2[1] > b?1:0)), \ + s2 = ((b0[2] > c?4:0) | (b1[2] > c?2:0) | (b2[2] > c?1:0))) + +#define SIDES_LESS(b0,b1,b2,s0,s1,s2,a,b,c) \ + (s0 = ((b0[0] < a?4:0) | (b1[0] < a?2:0) | (b2[0] < a?1:0)), \ + s1 = ((b0[1] < b?4:0) | (b1[1] < b?2:0) | (b2[1] < b?1:0)), \ + s2 = ((b0[2] < c?4:0) | (b1[2] < c?2:0) | (b2[2] < c?1:0))) + +/* +QUADTREE qtRoot_point_locate(qt,q0,q1,q2,peq,pt,r0,r1,r2) + QUADTREE qt; + FVECT q0,q1,q2; + FPEQ peq; + FVECT pt; + FVECT r0,r1,r2; + + Return the quadtree node containing pt. It is assumed that pt is in + the root node qt with ws vertices q0,q1,q2 and plane equation peq. + If r0 != NULL will return coordinates of node in (r0,r1,r2). +*/ + +extern QUADTREE qtRoot_point_locate(); +extern QUADTREE qtRoot_add_tri(); +extern QUADTREE qtRoot_remove_tri(); +extern QUADTREE qtAdd_tri(); +extern QUADTREE qtRoot_visit_tri_edges(); +extern QUADTREE qtRoot_trace_ray(); + + + + + +