Ignore:
Timestamp:
01/15/09 16:32:50 (16 years ago)
Author:
mattausch
Message:

problems with reimporting of my exported scenes

File:
1 edited

Legend:

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

    r3271 r3279  
    3838 
    3939        ViewCellsTree *viewCellsTree = new ViewCellsTree(); 
    40  
    4140        bool ok = viewCellsTree->_LoadFromFile(fr, viewCellsScaleFactor); 
    4241 
     
    10099                nodes.push_back(node); 
    101100 
    102                 if (!node->IsLeaf()) 
     101                if (!node->IsVirtualLeaf()) 
    103102                { 
    104103                        BvhInterior *interior = static_cast<BvhInterior *>(node); 
     
    116115 
    117116 
     117bool VisibilitySolutionLoader::CreateIdSortedList2(BvhNode *n, 
     118                                                                                                   BvhNodeContainer &nodes) 
     119{ 
     120        nodes.push_back(n); 
     121 
     122        if (!n->IsVirtualLeaf()) 
     123        { 
     124                BvhInterior *interior = static_cast<BvhInterior *>(n); 
     125 
     126                BvhNode *front = interior->GetFront(); 
     127                BvhNode *back = interior->GetBack(); 
     128 
     129                CreateIdSortedList2(front, nodes); 
     130                CreateIdSortedList2(back, nodes); 
     131        } 
     132 
     133        return true; 
     134} 
     135 
     136 
    118137bool VisibilitySolutionLoader::LoadPvs(FILE *fw, Bvh *bvh) 
    119138{ 
    120139        int number, entries; 
    121  
    122140        fread(&number, sizeof(int), 1, fw); 
    123141 
     
    135153 
    136154        BvhNodeContainer nodes; 
    137         CreateIdSortedList(bvh, nodes); 
    138          
     155        CreateIdSortedList2(bvh->GetStaticRoot(), nodes); 
     156        //CreateIdSortedList(bvh, nodes); 
     157        ofstream outstream("test.log"); 
     158 
     159        for (size_t i = 0; i < nodes.size(); ++ i) 
     160                outstream << "id " << nodes[i]->GetId() << endl; 
     161 
     162        outstream.close(); 
     163         
     164 
    139165        for (int i = 0; i < number; ++ i)  
    140166        { 
     
    194220                        AxisAlignedBox3 newBox1 = box; 
    195221                        AxisAlignedBox3 newBox2 = box; 
    196                         /*if (node->mPosition < newBox.Min(node->mAxis)) 
    197                                 cout << "e: " << node->mPosition << " " << newBox.Min(node->mAxis) << endl; 
    198                         else if (node->mPosition > newBox.Min(node->mAxis)) 
    199                                 cout << "o: " << node->mPosition << " " << newBox.Min(node->mAxis) << endl; 
    200 */ 
     222                 
    201223                        newBox1.SetMin(node->mAxis, node->mPosition); 
    202224                        newBox2.SetMax(node->mAxis, node->mPosition); 
Note: See TracChangeset for help on using the changeset viewer.