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}, 2, {
BOX_SIDE_Y,
BOX_SIDE_Z,-1} },
73 { 7, {2,6,7,5,1,0,4}, 3, {
BOX_SIDE_X,
BOX_SIDE_y,
BOX_SIDE_z} },
74 { 6, {6,7,5,1,0,4,-1}, 2, {
BOX_SIDE_X,
BOX_SIDE_y,-1} },
75 { 7, {6,7,3,1,0,4,5}, 3, {
BOX_SIDE_X,
BOX_SIDE_y,
BOX_SIDE_Z} },
76 { 6, {2,6,7,5,4,0,-1}, 2, {
BOX_SIDE_X,
BOX_SIDE_z,-1} },
77 { 4, {6,7,5,4,-1,-1,-1}, 1, {
BOX_SIDE_X,-1,-1} },
78 { 6, {6,7,3,1,5,4,-1}, 2, {
BOX_SIDE_X,
BOX_SIDE_Z,-1} },
79 { 7, {2,3,7,5,4,0,6}, 3, {
BOX_SIDE_X,
BOX_SIDE_Y,
BOX_SIDE_z} },
80 { 6, {2,3,7,5,4,6,-1}, 2, {
BOX_SIDE_X,
BOX_SIDE_Y,-1} },
81 { 7, {6,2,3,1,5,4,7}, 3, {
BOX_SIDE_X,
BOX_SIDE_Y,
BOX_SIDE_Z} }
217 if (pos.
x < bmin.
x) idx = 0*9;
218 else if (pos.
x > bmax.
x) idx = 2*9;
221 if (pos.
y < bmin.
y) idx += 0*3;
222 else if (pos.
y > bmax.
y) idx += 2*3;
225 if (pos.
z < bmin.
z) idx += 0;
226 else if (pos.
z > bmax.
z) idx += 2;
228 const Outline& ol = outlines[idx];
231 for (i = 0 ; i < num_array ; i++)
232 visible_sides[i] = ol.
sides[i];
237 csVector3* ar,
int& num_array,
bool bVisible)
const
243 if (pos.
x < bmin.
x) idx = 0*9;
244 else if (pos.
x > bmax.
x) idx = 2*9;
247 if (pos.
y < bmin.
y) idx += 0*3;
248 else if (pos.
y > bmax.
y) idx += 2*3;
251 if (pos.
z < bmin.
z) idx += 0;
252 else if (pos.
z > bmax.
z) idx += 2;
255 const Outline& ol = outlines[idx];
256 num_array = (bVisible ? ol.
num :
MIN (ol.
num, 6));
258 for (i = 0 ; i < num_array ; i++)
262 case 0: ar[i].
x = bmin.
x; ar[i].
y = bmin.
y; ar[i].
z = bmin.
z;
break;
263 case 1: ar[i].
x = bmin.
x; ar[i].
y = bmin.
y; ar[i].
z = bmax.
z;
break;
264 case 2: ar[i].
x = bmin.
x; ar[i].
y = bmax.
y; ar[i].
z = bmin.
z;
break;
265 case 3: ar[i].
x = bmin.
x; ar[i].
y = bmax.
y; ar[i].
z = bmax.
z;
break;
266 case 4: ar[i].
x = bmax.
x; ar[i].
y = bmin.
y; ar[i].
z = bmin.
z;
break;
267 case 5: ar[i].
x = bmax.
x; ar[i].
y = bmin.
y; ar[i].
z = bmax.
z;
break;
268 case 6: ar[i].
x = bmax.
x; ar[i].
y = bmax.
y; ar[i].
z = bmin.
z;
break;
269 case 7: ar[i].
x = bmax.
x; ar[i].
y = bmax.
y; ar[i].
z = bmax.
z;
break;