Ignore:
Timestamp:
01/04/09 16:06:56 (15 years ago)
Author:
mattausch
Message:

pvs seems to work now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp

    r3244 r3245  
    9090{ 
    9191        std::stack<BvhNode *> tStack; 
    92         tStack.push(bvh->GetRoot()); 
     92        tStack.push(bvh->GetStaticRoot()); 
    9393         
    9494        while (!tStack.empty()) 
     
    140140                fread(&entries, sizeof(int), 1, fw); 
    141141 
    142                 for (int j=0; j < entries; ++ j)  
     142                for (int j = 0; j < entries; ++ j)  
    143143                { 
    144144                        int objectId; 
     
    154154                        entities = bvh->GetGeometry(node, geometrySize); 
    155155 
     156                        //if (node->IsLeaf() && (geometrySize != 1)) 
     157                        //if (geometrySize != 1) cout << "Error!! " << geometrySize << endl; 
    156158                        for (int k = 0; k < geometrySize; ++ k) 
    157159                        { 
     
    175177 
    176178        mViewCells.clear(); 
    177          
     179        int axes[] = {0, 0, 0}; 
     180 
    178181        while (!nodeStack.empty())  
    179182        { 
     
    198201                        nodeStack.pop(); 
    199202 
    200                         AxisAlignedBox3 newBox = box; 
    201                         newBox.SetMin(node->mAxis, node->mPosition); 
    202  
    203                         nodeStack.push( 
    204                                 pair<ViewCellsTreeNode *, AxisAlignedBox3>(node->mFront, newBox) 
    205                                 ); 
    206  
    207                         newBox = box; 
    208                         newBox.SetMax(node->mAxis, node->mPosition); 
    209  
    210                         nodeStack.push( 
    211                                 pair<ViewCellsTreeNode *, AxisAlignedBox3>(node->mBack, newBox) 
    212                                 ); 
     203                        AxisAlignedBox3 newBox1 = box; 
     204                        AxisAlignedBox3 newBox2 = box; 
     205                        /*if (node->mPosition < newBox.Min(node->mAxis)) 
     206                                cout << "e: " << node->mPosition << " " << newBox.Min(node->mAxis) << endl; 
     207                        else if (node->mPosition > newBox.Min(node->mAxis)) 
     208                                cout << "o: " << node->mPosition << " " << newBox.Min(node->mAxis) << endl; 
     209*/ 
     210                        newBox1.SetMin(node->mAxis, node->mPosition); 
     211                        newBox2.SetMax(node->mAxis, node->mPosition); 
     212 
     213                        ++ axes[node->mAxis]; 
     214 
     215                        if (node->mAxis == 1) 
     216                        { 
     217                                nodeStack.push(pair<ViewCellsTreeNode *, AxisAlignedBox3>(node->mBack, newBox2)); 
     218                                nodeStack.push(pair<ViewCellsTreeNode *, AxisAlignedBox3>(node->mFront, newBox1)); 
     219                        } 
     220                        else 
     221                        { 
     222                                nodeStack.push(pair<ViewCellsTreeNode *, AxisAlignedBox3>(node->mFront, newBox1)); 
     223                                nodeStack.push(pair<ViewCellsTreeNode *, AxisAlignedBox3>(node->mBack, newBox2)); 
     224                        } 
    213225                } 
    214226        } 
    215227 
    216         cout << "#of viewcells = " << id << endl; 
    217 } 
    218  
    219  
    220 } 
     228        cout << "#of viewcells = " << id << " " << axes[0] << " " << axes[1] << " " << axes[2] << endl; 
     229} 
     230 
     231 
     232} 
Note: See TracChangeset for help on using the changeset viewer.