1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1990 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
57 |
|
if (i >= nroots) |
58 |
|
return(0); /* no positive root */ |
59 |
|
|
60 |
< |
if (t < r->rot) { /* found closer intersection */ |
61 |
< |
r->ro = so; |
62 |
< |
r->rot = t; |
63 |
< |
/* compute normal */ |
64 |
< |
a = ap[3]; |
65 |
< |
if (so->otype == OBJ_BUBBLE) |
66 |
< |
a = -a; /* reverse */ |
67 |
< |
for (i = 0; i < 3; i++) { |
68 |
< |
r->rop[i] = r->rorg[i] + r->rdir[i]*t; |
69 |
< |
r->ron[i] = (r->rop[i] - ap[i]) / a; |
70 |
< |
} |
71 |
< |
r->rod = -DOT(r->rdir, r->ron); |
60 |
> |
if (t >= r->rot) |
61 |
> |
return(0); /* other is closer */ |
62 |
> |
|
63 |
> |
r->ro = so; |
64 |
> |
r->rot = t; |
65 |
> |
/* compute normal */ |
66 |
> |
a = ap[3]; |
67 |
> |
if (so->otype == OBJ_BUBBLE) |
68 |
> |
a = -a; /* reverse */ |
69 |
> |
for (i = 0; i < 3; i++) { |
70 |
> |
r->rop[i] = r->rorg[i] + r->rdir[i]*t; |
71 |
> |
r->ron[i] = (r->rop[i] - ap[i]) / a; |
72 |
|
} |
73 |
< |
return(1); |
73 |
> |
r->rod = -DOT(r->rdir, r->ron); |
74 |
> |
r->rox = NULL; |
75 |
> |
|
76 |
> |
return(1); /* hit */ |
77 |
|
} |