- Timestamp:
- 01/20/06 22:32:51 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r561 r562 26 26 mTotalArea(0.0f), 27 27 mViewCellsFinished(false), 28 mMaxPvsSize(99999), 28 mMaxPvsSize(9999999), 29 mMinPvsSize(1), // only empty view cells are invalid 29 30 mMaxPvsRatio(1.0) 30 31 { … … 39 40 mPostProcessSamples(0), 40 41 mVisualizationSamples(0), 41 mViewCellsFinished(false) 42 mTotalAreaValid(false), 43 mTotalArea(0.0f), 44 mViewCellsFinished(false), 45 mMaxPvsSize(9999999), 46 mMinPvsSize(1), // only empty view cells are invalid 47 mMaxPvsRatio(1.0) 42 48 { 43 49 mViewSpaceBox.Initialize(); … … 111 117 112 118 bool ViewCellsManager::CheckValidity(ViewCell *vc, 113 float minPvsRatio,114 float maxPvsRatio) const115 { 116 if ((vc->GetPvs().GetSize() > mMaxPvsSize * maxPvsRatio) ||117 (vc->GetPvs().GetSize() < mM axPvsSize * minPvsRatio))119 int minPvsSize, 120 int maxPvsSize) const 121 { 122 if ((vc->GetPvs().GetSize() > mMaxPvsSize) || 123 (vc->GetPvs().GetSize() < mMinPvsSize)) 118 124 { 119 125 return false; … … 121 127 122 128 return true; 129 } 130 131 132 void ViewCellsManager::SetValidity(ViewCell *vc, 133 int minPvs, 134 int maxPvs) const 135 { 136 vc->SetValid(CheckValidity(vc, minPvs, maxPvs)); 123 137 } 124 138 … … 427 441 428 442 443 int ViewCellsManager::GetMinPvsSize() const 444 { 445 return mMinPvsSize; 446 } 447 448 449 429 450 float ViewCellsManager::GetMaxPvsRatio() const 430 451 { … … 442 463 // matt TODO: remove this!! 443 464 Ray hray(ray); 465 //static Ray hray; 466 //hray.Init(ray.GetOrigin(), ray.GetDir(), Ray::LINE_SEGMENT); 467 444 468 float tmin = 0, tmax = 1.0; 445 469 446 //hray.Init(ray.GetOrigin(), ray.GetDir(), Ray::LINE_SEGMENT);447 470 if (!GetViewSpaceBox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) 448 471 return; … … 451 474 Vector3 termination = hray.Extrap(tmax); 452 475 453 CastLineSegment(origin, 454 termination, 455 viewcells); 476 CastLineSegment(origin, termination, viewcells); 456 477 //Debug << "constribution: " << (int)viewcells.size() << endl; 457 478 // copy viewcells memory efficiently … … 2373 2394 ViewCell *vc) const 2374 2395 { 2375 if (CheckValidity(vc, 0.0, mMaxPvsRatio) && (mColorCode == 0)) // Random color2396 if (CheckValidity(vc, mMinPvsSize, mMaxPvsSize) && (mColorCode == 0)) // Random color 2376 2397 return; 2377 2398 … … 2406 2427 } 2407 2428 2408 m.mDiffuseColor.b = CheckValidity(vc, 0.0, mMaxPvsRatio) ? 1.0f : 0.0f;2429 m.mDiffuseColor.b = CheckValidity(vc, mMinPvsSize, mMaxPvsSize) ? 1.0f : 0.0f; 2409 2430 m.mDiffuseColor.r = importance; 2410 2431 m.mDiffuseColor.g = 1.0f - m.mDiffuseColor.r; … … 2488 2509 2489 2510 mViewCellsFinished = true; 2511 mMaxPvsSize = (int)objects->size(); 2490 2512 2491 2513 FinalizeViewCells(true); 2492 2514 2493 2515 Debug << (int)mViewCells.size() << " view cells loaded" << endl; 2494 2516
Note: See TracChangeset
for help on using the changeset viewer.