Changeset 1679 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
- Timestamp:
- 10/25/06 20:29:41 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1676 r1679 44 44 /***************************************************************/ 45 45 46 BvhNode::BvhNode(): mParent(NULL), mMailbox(0) 46 BvhNode::BvhNode(): 47 mParent(NULL), 48 mMailbox(0), 49 mRenderCostDecr(0), 50 mMemoryIncr(0), 51 mPvsEntriesIncr(0), 52 mTimeStamp(0) 47 53 { 48 54 } 49 55 50 56 BvhNode::BvhNode(const AxisAlignedBox3 &bbox): 51 mParent(NULL), mBoundingBox(bbox), mMailbox(0) 57 mParent(NULL), 58 mBoundingBox(bbox), 59 mMailbox(0), 60 mMemoryIncr(0), 61 mPvsEntriesIncr(0), 62 mTimeStamp(0) 52 63 { 53 64 } … … 55 66 56 67 BvhNode::BvhNode(const AxisAlignedBox3 &bbox, BvhInterior *parent): 57 mBoundingBox(bbox), mParent(parent), mMailbox(0) 68 mBoundingBox(bbox), 69 mParent(parent), 70 mMailbox(0), 71 mMemoryIncr(0), 72 mPvsEntriesIncr(0), 73 mTimeStamp(0) 58 74 { 59 75 } … … 400 416 backData.mMaxCostMisses = sc.GetMaxCostMisses(); 401 417 418 // set the time stamp so the order of traversal can be reconstructed 419 node->mTimeStamp = mHierarchyManager->mTimeStamp ++; 420 cout << "here4 " << node->mTimeStamp << endl; 421 node->mRenderCostDecr = sc.GetRenderCostDecrease(); 422 node->mPvsEntriesIncr = sc.GetPvsEntriesIncr(); 423 402 424 // assign the objects in sorted order 403 425 if (mUseGlobalSorting) … … 491 513 if (computeSplitPlane) 492 514 { 493 const bool sufficientSamples = splitCandidate.mParentData.mNumRays <mMinRaysForVisibility;515 const bool sufficientSamples = splitCandidate.mParentData.mNumRays > mMinRaysForVisibility; 494 516 495 517 const bool useVisibiliyBasedHeuristics = 496 518 !mUseSah && 497 !(mHierarchyManager->GetViewSpaceSubdivisionType() == HierarchyManager::KD_BASED_VIEWSPACE_SUBDIV) &&519 (mHierarchyManager->GetViewSpaceSubdivisionType() == HierarchyManager::KD_BASED_VIEWSPACE_SUBDIV) && 498 520 sufficientSamples; 499 521 … … 1259 1281 if (useVisibilityBasedHeuristics) 1260 1282 { 1283 //cout << "v"; 1261 1284 /////////// 1262 1285 //-- heuristics using objects weighted by view cells volume 1263 1286 nCostRatio[axis] = 1264 EvalLocalCostHeuristics( 1265 tData, 1266 axis, 1267 nFrontObjects[axis], 1268 nBackObjects[axis]); 1287 EvalLocalCostHeuristics(tData, axis, nFrontObjects[axis], nBackObjects[axis]); 1269 1288 } 1270 1289 else 1271 { 1290 {//cout << "e"; 1272 1291 ////////////////// 1273 1292 //-- view cells not constructed yet => use surface area heuristic 1274 1293 nCostRatio[axis] = 1275 EvalSah( 1276 tData, 1277 axis, 1278 nFrontObjects[axis], 1279 nBackObjects[axis]); 1294 EvalSah(tData, axis, nFrontObjects[axis], nBackObjects[axis]); 1280 1295 } 1281 1296 } … … 1284 1299 //-- split objects using some simple criteria 1285 1300 nCostRatio[axis] = 1286 EvalLocalObjectPartition( 1287 tData, 1288 axis, 1289 nFrontObjects[axis], 1290 nBackObjects[axis]); 1301 EvalLocalObjectPartition(tData, axis, nFrontObjects[axis], nBackObjects[axis]); 1291 1302 } 1292 1303
Note: See TracChangeset
for help on using the changeset viewer.