… | |
… | |
183 | #if 0 |
183 | #if 0 |
184 | if (vs.state == PARTIAL || vs.state == FULL) |
184 | if (vs.state == PARTIAL || vs.state == FULL) |
185 | ctx.nc_far = max (ctx.nc_far, z); |
185 | ctx.nc_far = max (ctx.nc_far, z); |
186 | #endif |
186 | #endif |
187 | |
187 | |
|
|
188 | if (vs.state == OCCLUDED && max (centeri) < extent) |
|
|
189 | vs.state = PARTIAL; |
|
|
190 | |
188 | if (vs.state == OCCLUDED) |
191 | if (vs.state == OCCLUDED) |
189 | { |
192 | { |
190 | #if 0 |
193 | #if 0 |
191 | if (extent < ctx.z_far) |
194 | if (extent < ctx.z_far) |
192 | { |
195 | { |
… | |
… | |
198 | else |
201 | else |
199 | vs.state == PARTIAL; |
202 | vs.state == PARTIAL; |
200 | #endif |
203 | #endif |
201 | } |
204 | } |
202 | |
205 | |
203 | bool visible = size () && vs.state == FULL; |
206 | bool visible = size () && vs.state != OCCLUDED; |
204 | |
207 | |
205 | // node to start with |
208 | // node to start with |
206 | unsigned char si = centeri.x > 0 ? 1 : 0 |
209 | unsigned char si = centeri.x > 0 ? 1 : 0 |
207 | | centeri.y > 0 ? 2 : 0 |
210 | | centeri.y > 0 ? 2 : 0 |
208 | | centeri.z > 0 ? 4 : 0; |
211 | | centeri.z > 0 ? 4 : 0; |
… | |
… | |
219 | if (sub[si]) |
222 | if (sub[si]) |
220 | visible = visible | sub[si]->detect_visibility (ctx); |
223 | visible = visible | sub[si]->detect_visibility (ctx); |
221 | } |
224 | } |
222 | while (*++next); |
225 | while (*++next); |
223 | |
226 | |
224 | if (visible) |
227 | if (visible || 1) |
225 | { |
228 | { |
226 | if (size ()) |
229 | if (size ()) |
227 | ctx.vislist.push_back (this); |
230 | ctx.vislist.push_back (this); |
228 | |
231 | |
229 | ctx.postdepthlist.push_back (this); |
232 | ctx.postdepthlist.push_back (this); |
… | |
… | |
241 | { |
244 | { |
242 | oct_visibility &vs = *(oct_visibility *)get_visibility (ctx); |
245 | oct_visibility &vs = *(oct_visibility *)get_visibility (ctx); |
243 | |
246 | |
244 | vs.vismap.resize (size ()); |
247 | vs.vismap.resize (size ()); |
245 | |
248 | |
|
|
249 | #if 0 |
246 | if (vs.state == PARTIAL || vs.state == OCCLUDED) |
250 | if (vs.state == PARTIAL || vs.state == OCCLUDED) |
247 | return; |
251 | return; |
|
|
252 | #endif |
248 | |
253 | |
249 | for (int i = 0; i < size (); ++i) |
254 | for (int i = 0; i < size (); ++i) |
250 | { |
255 | { |
251 | entity *e = (*this)[i]; |
256 | entity *e = (*this)[i]; |
252 | const evis &evs = vs.get_visibility (i, e); |
257 | const evis &evs = vs.get_visibility (i, e); |
… | |
… | |
299 | } |
304 | } |
300 | else |
305 | else |
301 | nvis++; |
306 | nvis++; |
302 | } |
307 | } |
303 | |
308 | |
304 | #if 0 |
309 | #if 1 |
305 | if (nvis == 0 && size ()) |
310 | if (nvis == 0 && size ()) |
306 | vs.state = PARTIAL; |
311 | vs.state = PARTIAL; |
307 | #endif |
312 | #endif |
308 | } |
313 | } |
309 | } |
314 | } |
310 | |
315 | |
311 | void octant::draw_lighted (view &ctx) |
316 | void octant::draw_lighted (view &ctx) |
312 | { |
317 | { |
313 | oct_visibility &vs = *(oct_visibility *)get_visibility (ctx); |
318 | oct_visibility &vs = *(oct_visibility *)get_visibility (ctx); |
314 | |
319 | |
315 | #if 0 |
320 | #if 1 |
316 | if (vs.state == PARTIAL || vs.state == OCCLUDED) |
321 | if (vs.state == PARTIAL || vs.state == OCCLUDED) |
317 | { |
322 | { |
|
|
323 | if (orig.z + extent < -10000000) { |
318 | sector s = orig - ctx.orig; |
324 | sector s = orig - ctx.orig; |
319 | gl::draw_bbox (s - extent, s + extent); |
325 | gl::draw_bbox (s - extent, s + extent); |
320 | printf ("DLP %p\n", this);//D |
326 | //printf ("DLP %ld %ld %ld (%ld)\n", orig.x, orig.y, orig.z, extent);//D |
|
|
327 | } |
321 | } |
328 | } |
322 | #endif |
329 | #endif |
323 | |
330 | |
324 | if (vs.state == PARTIAL || vs.state == OCCLUDED) |
331 | if (vs.state == PARTIAL || vs.state == OCCLUDED) |
325 | return; |
332 | return; |