Changeset 1716 for GTP/trunk/Lib/Vis
- Timestamp:
- 11/06/06 23:33:16 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1715 r1716 2451 2451 ) 2452 2452 { 2453 2454 2455 2456 2457 2458 2453 // now compute a new Pvs by including also objects intersecting the 2454 // extended boxes of visible objects 2455 Intersectable::NewMail(); 2456 2457 ObjectPvsMap::const_iterator oi; 2458 2459 2459 for (oi = pvs.mEntries.begin(); oi != pvs.mEntries.end(); ++ oi) 2460 2460 { 2461 2461 Intersectable *object = (*oi).first; 2462 2462 object->Mail(); 2463 2463 } 2464 2464 2465 2465 ObjectPvs nPvs; … … 2475 2475 AxisAlignedBox3 box = object->GetBox(); 2476 2476 box.Enlarge(Vector3(spatialFilterSize/2)); 2477 2477 2478 2478 ObjectContainer objects; 2479 2479 2480 2480 // $$ warning collect objects takes only unmailed ones! 2481 2481 kdTree->CollectObjects(box, objects); … … 2502 2502 ) 2503 2503 { 2504 // first determine the average 2505 2506 2507 2508 } 2504 Vector3 center = viewCell->GetBox().Center(); 2505 // first determine the average size of the filter 2506 2507 2508 2509 Intersectable::NewMail(); 2510 ObjectPvsMap::const_iterator oi; 2511 // first mark all object from this pvs 2512 for (oi = pvs.mEntries.begin(); oi != pvs.mEntries.end(); ++ oi) { 2513 Intersectable *object = (*oi).first; 2514 object->Mail(); 2515 } 2516 2517 ObjectPvs nPvs; 2518 int pvsSize = 0; 2519 int nPvsSize = 0; 2520 int samples = pvs.mSamples; 2521 2522 2523 for (oi = pvs.mEntries.begin(); oi != pvs.mEntries.end(); ++oi, pvsSize++) { 2524 Intersectable *object = (*oi).first; 2525 // compute filter size based on the distance and the numebr of samples 2526 float distance = Distance(center, object->GetBox().Center()); 2527 2528 // now compute the filter size 2529 float radius = distance*(filterSize/(4*samples)); 2530 AxisAlignedBox3 box = object->GetBox(); 2531 box.Enlarge(Vector3(radius)); 2532 2533 ObjectContainer objects; 2534 // $$ warning collect objects takes only unmailed ones! 2535 // should use VspOsp!! 2536 kdTree->CollectObjects(box, objects); 2537 // cout<<"collected objects="<<objects.size()<<endl; 2538 ObjectContainer::const_iterator noi = objects.begin(); 2539 for (; noi != objects.end(); ++ noi) { 2540 Intersectable *o = *noi; 2541 // $$ JB warning: pdfs are not correct at this point! 2542 nPvs.AddSample(o, Limits::Small); 2543 nPvsSize ++; 2544 } 2545 } 2546 // cout<<"nPvs size = "<<nPvsSize<<endl; 2547 pvs.Merge(nPvs); 2548 } 2549 2550 2551 2509 2552 2510 2553
Note: See TracChangeset
for help on using the changeset viewer.