72 |
|
vloc &= j; |
73 |
|
} |
74 |
|
if (vout == 0) /* all inside */ |
75 |
< |
return(2); |
75 |
> |
return(O_IN); |
76 |
|
if (vout < 8) /* some inside */ |
77 |
< |
return(1); |
77 |
> |
return(O_HIT); |
78 |
|
if (vloc) /* all to one side */ |
79 |
< |
return(0); |
79 |
> |
return(O_MISS); |
80 |
|
/* octree vertices in cube? */ |
81 |
|
for (j = 0; j < 3; j++) |
82 |
|
cumax[j] = (cumin[j] = cu->cuorg[j]) + cu->cusize; |
91 |
|
if (j = plocate(vert[i], cumin, cumax)) |
92 |
|
vloc &= j; |
93 |
|
else |
94 |
< |
return(1); /* vertex inside */ |
94 |
> |
return(O_HIT); /* vertex inside */ |
95 |
|
} |
96 |
|
if (vloc) /* all to one side */ |
97 |
< |
return(0); |
97 |
> |
return(O_MISS); |
98 |
|
/* check edges */ |
99 |
|
for (i = 0; i < 4; i++) |
100 |
|
for (j = 0; j < 3; j++) { |
102 |
|
VCOPY(v1, vert[vstart[i]]); |
103 |
|
VCOPY(v2, vert[vstart[i] ^ 1<<j]); |
104 |
|
if (clip(v1, v2, cumin, cumax)) |
105 |
< |
return(1); /* edge inside */ |
105 |
> |
return(O_HIT); /* edge inside */ |
106 |
|
} |
107 |
|
|
108 |
< |
return(0); /* no intersection */ |
108 |
> |
return(O_MISS); /* no intersection */ |
109 |
|
} |