Changeset 609 for trunk/VUT/GtpVisibilityPreprocessor
- Timestamp:
- 02/09/06 01:18:31 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
r608 r609 199 199 bool mIsActive; 200 200 201 201 202 protected: 202 203 203 204 204 /// the potentially visible objects -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r607 r609 699 699 int axis = 0; 700 700 701 const float factor = 0. 35;701 const float factor = 0.65; 702 702 Vector3 point = mViewSpaceBox.Min() + mViewSpaceBox.Size() * factor; 703 703 … … 2613 2613 2614 2614 2615 bool VspBspViewCellsManager::EqualToSpatialNode(ViewCell *viewCell) 2616 { 2617 BspNode *node; 2618 return EqualToSpatialNode(viewCell, &node); 2619 } 2620 2621 2622 bool VspBspViewCellsManager::EqualToSpatialNode(ViewCell *viewCell, BspNode **node) 2615 bool VspBspViewCellsManager::EqualToSpatialNode(ViewCell *viewCell) const 2616 { 2617 return GetSpatialNode(viewCell) != NULL; 2618 } 2619 2620 2621 BspNode *VspBspViewCellsManager::GetSpatialNode(ViewCell *viewCell) const 2623 2622 { 2624 2623 if (!viewCell->IsLeaf()) … … 2626 2625 BspViewCell *bspVc = dynamic_cast<BspViewCell *>(viewCell); 2627 2626 2628 *node = bspVc->mLeaf; 2629 return true; 2630 } 2627 return bspVc->mLeaf; 2628 } 2631 2629 else 2632 2630 { … … 2635 2633 // cannot be node of binary tree 2636 2634 if (interior->mChildren.size() != 2) 2637 return false;2635 return NULL; 2638 2636 2639 2637 ViewCell *left = interior->mChildren[0]; 2640 2638 ViewCell *right = interior->mChildren[1]; 2641 2639 2642 BspNode *leftNode; 2643 BspNode *rightNode; 2644 2645 if (EqualToSpatialNode(left, &leftNode) && EqualToSpatialNode(right, &rightNode)) 2646 { 2647 *node = leftNode->GetParent(); 2648 return leftNode->IsSibling(rightNode); 2649 } 2650 2651 *node = NULL; 2652 2653 return false; 2654 } 2640 BspNode *leftNode = GetSpatialNode(left); 2641 BspNode *rightNode = GetSpatialNode(right); 2642 2643 if (leftNode && rightNode && leftNode->IsSibling(rightNode)) 2644 { 2645 return leftNode->GetParent(); 2646 } 2647 } 2648 2649 return NULL; 2655 2650 } 2656 2651 … … 2691 2686 2692 2687 2693 // view cells already finished before post processing step (i.e. because they were loaded) 2688 // view cells already finished before post processing step 2689 // (i.e. because they were loaded) 2694 2690 if (mViewCellsFinished) 2695 2691 { … … 2790 2786 { 2791 2787 return VSP_BSP; 2788 } 2789 2790 2791 void VspBspViewCellsManager::CreateMergeHierarchy() 2792 { 2793 2792 2794 } 2793 2795 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h
r607 r609 213 213 /** Returns render cost of a single view cell given the render cost of an object. 214 214 */ 215 virtual float GetRendercost(ViewCell *viewCell, float objRendercost) const;215 float GetRendercost(ViewCell *viewCell, float objRendercost) const; 216 216 217 217 /** Returns container of loaded / generated view cells. … … 293 293 int maxPvsSize) const; 294 294 295 /** set valid viewcells in the range of pvs. sorts the viewcells 295 296 /** set valid viewcells in the range of pvs. sorts the viewcells 296 297 according to the pvs and then pickups those in the ranges */ 297 298 void 299 SetValidityPercentage( 300 const float minValid, 301 const float maxValid 302 ); 303 304 int 305 CountValidViewcells() const; 298 299 300 void SetValidityPercentage(const float minValid, const float maxValid); 301 302 int CountValidViewcells() const; 306 303 307 304 /** Returns maximal allowed pvs size. … … 352 349 vector<MergeCandidate> &candidates) = 0; 353 350 354 355 void CollectViewCells(const int n) 356 { 357 mNumActiveViewCells = n; 358 mViewCells.clear(); 359 CollectViewCells(); 360 } 361 362 bool EqualToSpatialNode(ViewCell *viewCell) { return false;} // implemented in subclasses 363 364 365 351 352 353 void CollectViewCells(const int n) { 354 mNumActiveViewCells = n; 355 mViewCells.clear(); 356 CollectViewCells(); 357 } 358 359 360 virtual bool EqualToSpatialNode(ViewCell *viewCell) const { return false;} 366 361 protected: 367 362 368 363 369 364 /** … … 606 601 607 602 float GetProbability(ViewCell *viewCell); 608 603 609 604 610 605 void CreateMesh(ViewCell *vc); … … 672 667 673 668 float GetProbability(ViewCell *viewCell); 674 669 675 670 676 671 void CreateMesh(ViewCell *vc); … … 732 727 float GetProbability(ViewCell *viewCell); 733 728 734 735 729 ViewCell *GetViewCell(const Vector3 &point) const; 736 730 … … 756 750 void CollectMergeCandidates(const VssRayContainer &rays, vector<MergeCandidate> &candidates); 757 751 758 bool EqualToSpatialNode(ViewCell *viewCell) ;752 bool EqualToSpatialNode(ViewCell *viewCell) const; 759 753 760 754 protected: 761 755 762 bool EqualToSpatialNode(ViewCell *viewCell, BspNode **node); 763 756 BspNode *GetSpatialNode(ViewCell *viewCell) const; 764 757 /** HACK 765 758 */ -
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r607 r609 430 430 431 431 tQueue.push(tData); 432 432 433 433 434 mTotalCost = tData.mPvs * tData.mProbability / mBox.GetVolume();
Note: See TracChangeset
for help on using the changeset viewer.