Changeset 609


Ignore:
Timestamp:
02/09/06 01:18:31 (18 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h

    r608 r609  
    199199        bool mIsActive; 
    200200 
     201         
    201202protected: 
    202  
    203203 
    204204        /// the potentially visible objects 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp

    r607 r609  
    699699        int axis = 0; 
    700700 
    701         const float factor = 0.35; 
     701        const float factor = 0.65; 
    702702        Vector3 point = mViewSpaceBox.Min() +  mViewSpaceBox.Size() * factor; 
    703703 
     
    26132613 
    26142614 
    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) 
     2615bool VspBspViewCellsManager::EqualToSpatialNode(ViewCell *viewCell) const 
     2616{ 
     2617        return GetSpatialNode(viewCell) != NULL; 
     2618} 
     2619 
     2620 
     2621BspNode *VspBspViewCellsManager::GetSpatialNode(ViewCell *viewCell) const 
    26232622{ 
    26242623        if (!viewCell->IsLeaf()) 
     
    26262625                BspViewCell *bspVc = dynamic_cast<BspViewCell *>(viewCell); 
    26272626 
    2628                 *node = bspVc->mLeaf; 
    2629         return true; 
    2630         } 
     2627                return bspVc->mLeaf; 
     2628        } 
    26312629        else 
    26322630        { 
     
    26352633                // cannot be node of binary tree 
    26362634                if (interior->mChildren.size() != 2) 
    2637                         return false; 
     2635                        return NULL; 
    26382636 
    26392637                ViewCell *left = interior->mChildren[0]; 
    26402638                ViewCell *right = interior->mChildren[1]; 
    26412639 
    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; 
    26552650} 
    26562651 
     
    26912686 
    26922687 
    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) 
    26942690        if (mViewCellsFinished) 
    26952691        { 
     
    27902786{ 
    27912787        return VSP_BSP; 
     2788} 
     2789 
     2790 
     2791void VspBspViewCellsManager::CreateMergeHierarchy() 
     2792{ 
     2793         
    27922794} 
    27932795 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h

    r607 r609  
    213213        /** Returns render cost of a single view cell given the render cost of an object. 
    214214        */ 
    215         virtual float GetRendercost(ViewCell *viewCell, float objRendercost) const ; 
     215        float GetRendercost(ViewCell *viewCell, float objRendercost) const; 
    216216 
    217217        /** Returns container of loaded / generated view cells. 
     
    293293                                                         int maxPvsSize) const; 
    294294 
    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 
    296297          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; 
    306303 
    307304        /** Returns maximal allowed pvs size. 
     
    352349                                                                                vector<MergeCandidate> &candidates) = 0; 
    353350 
    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;} 
    366361protected: 
    367          
     362 
    368363 
    369364        /** 
     
    606601 
    607602        float GetProbability(ViewCell *viewCell); 
    608  
     603         
    609604 
    610605        void CreateMesh(ViewCell *vc); 
     
    672667 
    673668        float GetProbability(ViewCell *viewCell); 
    674          
     669 
    675670 
    676671        void CreateMesh(ViewCell *vc); 
     
    732727        float GetProbability(ViewCell *viewCell); 
    733728         
    734          
    735729        ViewCell *GetViewCell(const Vector3 &point) const; 
    736730 
     
    756750        void CollectMergeCandidates(const VssRayContainer &rays, vector<MergeCandidate> &candidates); 
    757751 
    758         bool EqualToSpatialNode(ViewCell *viewCell); 
     752        bool EqualToSpatialNode(ViewCell *viewCell) const; 
    759753 
    760754protected: 
    761755 
    762         bool EqualToSpatialNode(ViewCell *viewCell, BspNode **node); 
    763  
     756        BspNode *GetSpatialNode(ViewCell *viewCell) const; 
    764757        /** HACK 
    765758        */ 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp

    r607 r609  
    430430 
    431431        tQueue.push(tData); 
     432 
    432433 
    433434        mTotalCost = tData.mPvs * tData.mProbability / mBox.GetVolume(); 
Note: See TracChangeset for help on using the changeset viewer.