| 59 |
|
if (findcseg(ep0, ep1, co, p) > 0.0) { |
| 60 |
|
/* check min. distance to cone */ |
| 61 |
|
if (dist2lseg(p, ep0, ep1) > (r+FTINY)*(r+FTINY)) |
| 62 |
< |
return(0); |
| 62 |
> |
return(O_MISS); |
| 63 |
|
#ifdef STRICT |
| 64 |
|
/* get cube boundaries */ |
| 65 |
|
for (i = 0; i < 3; i++) |
| 66 |
|
cumax[i] = (cumin[i] = cu->cuorg[i]) + cu->cusize; |
| 67 |
|
/* closest segment intersects? */ |
| 68 |
|
if (clip(ep0, ep1, cumin, cumax)) |
| 69 |
< |
return(1); |
| 69 |
> |
return(O_HIT); |
| 70 |
|
} |
| 71 |
|
/* check sub-cubes */ |
| 72 |
|
cukid.cusize = cu->cusize * 0.5; |
| 73 |
|
if (cukid.cusize < mincusize) |
| 74 |
< |
return(1); /* cube too small */ |
| 74 |
> |
return(O_HIT); /* cube too small */ |
| 75 |
|
cukid.cutree = EMPTY; |
| 76 |
|
|
| 77 |
|
for (j = 0; j < 8; j++) { |
| 81 |
|
cukid.cuorg[i] += cukid.cusize; |
| 82 |
|
} |
| 83 |
|
if (o_cone(o, &cukid)) |
| 84 |
< |
return(1); /* sub-cube intersects */ |
| 84 |
> |
return(O_HIT); /* sub-cube intersects */ |
| 85 |
|
} |
| 86 |
< |
return(0); /* no intersection */ |
| 86 |
> |
return(O_MISS); /* no intersection */ |
| 87 |
|
#else |
| 88 |
|
} |
| 89 |
< |
return(1); /* assume intersection */ |
| 89 |
> |
return(O_HIT); /* assume intersection */ |
| 90 |
|
#endif |
| 91 |
|
} |
| 92 |
|
|