--- ray/src/rt/o_face.c 2003/03/11 17:08:55 2.4 +++ ray/src/rt/o_face.c 2006/03/02 16:51:55 2.6 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: o_face.c,v 2.4 2003/03/11 17:08:55 greg Exp $"; +static const char RCSid[] = "$Id: o_face.c,v 2.6 2006/03/02 16:51:55 greg Exp $"; #endif /* * o_face.c - compute ray intersection with faces. @@ -8,19 +8,20 @@ static const char RCSid[] = "$Id: o_face.c,v 2.4 2003/ #include "copyright.h" #include "ray.h" - #include "face.h" +#include "rtotypes.h" -o_face(o, r) /* compute intersection with polygonal face */ -OBJREC *o; -register RAY *r; +extern int +o_face( /* compute intersection with polygonal face */ + OBJREC *o, + register RAY *r +) { double rdot; /* direction . normal */ double t; /* distance to intersection */ FVECT pisect; /* intersection point */ register FACE *f; /* face record */ - register int i; f = getface(o); @@ -43,8 +44,7 @@ register RAY *r; if (t <= FTINY || t >= r->rot) /* not good enough */ return(0); /* compute intersection */ - for (i = 0; i < 3; i++) - pisect[i] = r->rorg[i] + r->rdir[i]*t; + VSUM(pisect, r->rorg, r->rdir, t); if (!inface(pisect, f)) /* ray intersects face? */ return(0);