- Timestamp:
- 09/22/08 00:20:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhLoader.cpp
r2800 r2962 62 62 63 63 Bvh *bvh = new Bvh(entities); 64 bvh->mRoot = LoadNextNode(stream, NULL); 64 65 BvhNode *root = LoadNextNode(stream, NULL); 66 67 #if 0 68 69 bvh->mRoot = root; 70 71 #else 72 // copy root and set new one for dynamic objects 73 BvhInterior *newRoot = new BvhInterior(NULL); 74 75 newRoot->mBox = root->mBox; 76 newRoot->mFirst = root->mFirst; 77 newRoot->mLast = root->mLast; 78 79 // create 'dynamic' leaf which basicly is a container 80 // for all dynamic objects 81 BvhLeaf *dynamicLeaf = new BvhLeaf(newRoot); 82 dynamicLeaf->mBox = root->mBox; 83 84 newRoot->mFront = root; 85 root->mParent = newRoot; 86 87 newRoot->mBack = dynamicLeaf; 88 89 bvh->mRoot = newRoot; 90 #endif 65 91 66 92 tQueue.push(bvh->mRoot); … … 92 118 } 93 119 94 cout << "... finished loading " << bvh->mNumNodes << " nodes, updating boxes"<< endl;120 cout << "... finished loading " << bvh->mNumNodes << " scene box: " << bvh->mBox << endl; 95 121 96 122 bvh->mBox = bvh->mRoot->GetBox(); 97 123 98 cout << "scene box: " << bvh->mBox << endl; 99 124 100 125 /////////// 101 126 //-- post process nodes … … 111 136 // specify bounds for occlusion tests 112 137 bvh->RecomputeBounds(); 138 113 139 // compute and print stats 114 140 bvh->ComputeBvhStats();
Note: See TracChangeset
for help on using the changeset viewer.