138 |
|
register CUBE *cu; |
139 |
|
OBJECT obj; |
140 |
|
{ |
141 |
– |
CUBE cukid; |
142 |
– |
OCTREE ot; |
143 |
– |
OBJECT oset[MAXSET+1]; |
144 |
– |
register int i, j; |
141 |
|
|
142 |
|
if (o_face(objptr(obj), cu) == O_MISS) |
143 |
|
return; |
144 |
|
|
145 |
|
if (istree(cu->cutree)) { |
146 |
< |
/* do children */ |
146 |
> |
CUBE cukid; /* do children */ |
147 |
> |
int i, j; |
148 |
|
cukid.cusize = cu->cusize * 0.5; |
149 |
|
for (i = 0; i < 8; i++) { |
150 |
|
cukid.cutree = octkid(cu->cutree, i); |
159 |
|
return; |
160 |
|
} |
161 |
|
if (isempty(cu->cutree)) { |
162 |
< |
/* singular set */ |
162 |
> |
OBJECT oset[2]; /* singular set */ |
163 |
|
oset[0] = 1; oset[1] = obj; |
164 |
|
cu->cutree = fullnode(oset); |
165 |
|
return; |
166 |
|
} |
167 |
|
/* add to full node */ |
168 |
+ |
add2full(cu, obj); |
169 |
+ |
} |
170 |
+ |
|
171 |
+ |
|
172 |
+ |
add2full(cu, obj) /* add object to full node */ |
173 |
+ |
register CUBE *cu; |
174 |
+ |
OBJECT obj; |
175 |
+ |
{ |
176 |
+ |
OCTREE ot; |
177 |
+ |
OBJECT oset[MAXSET+1]; |
178 |
+ |
CUBE cukid; |
179 |
+ |
register int i, j; |
180 |
+ |
|
181 |
|
objset(oset, cu->cutree); |
182 |
|
cukid.cusize = cu->cusize * 0.5; |
183 |
|
|
184 |
|
if (oset[0] < objlim || cukid.cusize < mincusize) { |
185 |
|
/* add to set */ |
186 |
|
if (oset[0] >= MAXSET) { |
187 |
< |
sprintf(errmsg, "set overflow in addface (%s)", |
187 |
> |
sprintf(errmsg, "set overflow in addobject (%s)", |
188 |
|
objptr(obj)->oname); |
189 |
|
error(INTERNAL, errmsg); |
190 |
|
} |