--- ray/src/ot/o_face.c 1989/10/14 11:19:32 1.3 +++ ray/src/ot/o_face.c 2004/03/27 12:41:45 2.4 @@ -1,9 +1,6 @@ -/* Copyright (c) 1986 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: o_face.c,v 2.4 2004/03/27 12:41:45 schorsch Exp $"; #endif - /* * o_face.c - routines for creating octrees for polygonal faces. * @@ -40,10 +37,12 @@ static char SCCSid[] = "$SunId$ LBL"; * 5) If test 4 fails, we have no intersection. */ - -o_face(o, cu) /* determine if face intersects cube */ -OBJREC *o; -CUBE *cu; +/* XXX this is extern, but not declared in any header file yet */ +int +o_face( /* determine if face intersects cube */ + OBJREC *o, + CUBE *cu +) { FVECT cumin, cumax; FVECT v1, v2; @@ -57,11 +56,12 @@ CUBE *cu; return(O_MISS); /* compute cube boundaries */ for (j = 0; j < 3; j++) - cumax[j] = (cumin[j] = cu->cuorg[j]) + cu->cusize; + cumax[j] = (cumin[j] = cu->cuorg[j]-FTINY) + + cu->cusize + 2.0*FTINY; vloc = ABOVE | BELOW; /* check vertices */ for (i = 0; i < f->nv; i++) - if (j = plocate(VERTEX(f,i), cumin, cumax)) + if ( (j = plocate(VERTEX(f,i), cumin, cumax)) ) vloc &= j; else return(O_HIT); /* vertex inside */