12 |
|
#include "rtotypes.h" |
13 |
|
|
14 |
|
|
15 |
< |
extern int |
15 |
> |
int |
16 |
|
o_face( /* compute intersection with polygonal face */ |
17 |
|
OBJREC *o, |
18 |
< |
register RAY *r |
18 |
> |
RAY *r |
19 |
|
) |
20 |
|
{ |
21 |
|
double rdot; /* direction . normal */ |
22 |
|
double t; /* distance to intersection */ |
23 |
|
FVECT pisect; /* intersection point */ |
24 |
< |
register FACE *f; /* face record */ |
25 |
< |
register int i; |
24 |
> |
FACE *f; /* face record */ |
25 |
|
|
26 |
|
f = getface(o); |
27 |
|
|
44 |
|
if (t <= FTINY || t >= r->rot) /* not good enough */ |
45 |
|
return(0); |
46 |
|
/* compute intersection */ |
47 |
< |
for (i = 0; i < 3; i++) |
49 |
< |
pisect[i] = r->rorg[i] + r->rdir[i]*t; |
47 |
> |
VSUM(pisect, r->rorg, r->rdir, t); |
48 |
|
|
49 |
|
if (!inface(pisect, f)) /* ray intersects face? */ |
50 |
|
return(0); |