- Timestamp:
- 01/04/09 16:06:56 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp
r3244 r3245 90 90 { 91 91 std::stack<BvhNode *> tStack; 92 tStack.push(bvh->Get Root());92 tStack.push(bvh->GetStaticRoot()); 93 93 94 94 while (!tStack.empty()) … … 140 140 fread(&entries, sizeof(int), 1, fw); 141 141 142 for (int j =0; j < entries; ++ j)142 for (int j = 0; j < entries; ++ j) 143 143 { 144 144 int objectId; … … 154 154 entities = bvh->GetGeometry(node, geometrySize); 155 155 156 //if (node->IsLeaf() && (geometrySize != 1)) 157 //if (geometrySize != 1) cout << "Error!! " << geometrySize << endl; 156 158 for (int k = 0; k < geometrySize; ++ k) 157 159 { … … 175 177 176 178 mViewCells.clear(); 177 179 int axes[] = {0, 0, 0}; 180 178 181 while (!nodeStack.empty()) 179 182 { … … 198 201 nodeStack.pop(); 199 202 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 } 213 225 } 214 226 } 215 227 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.