| 63 |
|
break; |
| 64 |
|
if (i >= nroots) |
| 65 |
|
return(0); /* no positive root */ |
| 66 |
< |
if (rayreject(so, r, t, 0)) |
| 66 |
> |
if (rayreject(so, r, t, 1 - 2*((i>0)^(so->otype==OBJ_BUBBLE)))) |
| 67 |
|
return(0); /* previous hit better */ |
| 68 |
|
|
| 69 |
|
r->ro = so; |
| 70 |
|
r->rot = t; |
| 71 |
|
/* compute normal */ |
| 72 |
< |
a = ap[3]; |
| 73 |
< |
if (so->otype == OBJ_BUBBLE) |
| 74 |
< |
a = -a; /* reverse */ |
| 72 |
> |
a = ap[3] * (1 - 2*(so->otype==OBJ_BUBBLE)); |
| 73 |
|
for (i = 0; i < 3; i++) { |
| 74 |
|
r->rop[i] = r->rorg[i] + r->rdir[i]*t; |
| 75 |
|
r->ron[i] = (r->rop[i] - ap[i]) / a; |