Changeset 1758 for GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
- Timestamp:
- 11/15/06 16:07:29 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1750 r1758 1451 1451 { 1452 1452 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 1453 BvhIntersectable *bvhObj = mBvHierarchy->GetOrCreateBvhIntersectable(leaf);1454 1453 1455 return vc->AddPvsSample( bvhObj, pdf, contribution);1454 return vc->AddPvsSample(leaf, pdf, contribution); 1456 1455 } 1457 1456 default: … … 1522 1521 const Vector3 &point) const 1523 1522 { 1524 1525 1526 return NULL;1527 1528 1523 1524 if (!obj) 1525 return NULL; 1526 1527 switch (mObjectSpaceSubdivisionType) 1529 1528 { 1530 1529 case HierarchyManager::KD_BASED_OBJ_SUBDIV: 1531 1532 KdLeaf *leaf = mOspTree->GetLeaf(point, NULL);1533 return mOspTree->GetOrCreateKdIntersectable(leaf);1534 1530 { 1531 KdLeaf *leaf = mOspTree->GetLeaf(point, NULL); 1532 return mOspTree->GetOrCreateKdIntersectable(leaf); 1533 } 1535 1534 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 1536 1537 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj);1538 return mBvHierarchy->GetOrCreateBvhIntersectable(leaf);1539 1535 { 1536 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 1537 return leaf; 1538 } 1540 1539 default: 1541 1540 return obj; 1542 1541 } 1543 1542 } … … 1546 1545 const bool isTermination) const 1547 1546 { 1548 1547 Intersectable *obj = NULL; 1549 1548 Vector3 pt; 1550 1549 KdNode *node; 1551 1550 1552 1551 ray.GetSampleData(isTermination, pt, &obj, &node); 1553 1552 1554 1553 if (!obj) 1555 1554 return NULL; 1556 1555 1557 1556 switch (mObjectSpaceSubdivisionType) … … 1559 1558 case HierarchyManager::KD_BASED_OBJ_SUBDIV: 1560 1559 { 1561 1560 KdLeaf *leaf = mOspTree->GetLeaf(pt, node); 1562 1561 return mOspTree->GetOrCreateKdIntersectable(leaf); 1563 1562 } … … 1565 1564 { 1566 1565 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 1567 return mBvHierarchy->GetOrCreateBvhIntersectable(leaf);1566 return leaf; 1568 1567 } 1569 1568 default: 1570 1569 break; 1571 1570 } 1572 1571 return obj; … … 1839 1838 ObjectPvsEntry entry = pit.Next(); 1840 1839 1841 BvhIntersectable *intersect = dynamic_cast<BvhIntersectable *>(entry.mObject); 1842 1843 BvhLeaf *leaf = intersect->GetItem(); 1844 BvhNode *activeNode = leaf->GetActiveNode(); 1840 BvhNode *activeNode; 1841 BvhNode *intersect = dynamic_cast<BvhNode *>(entry.mObject); 1842 1843 // hack for choosing which node to account for 1844 if (intersect->IsLeaf()) 1845 activeNode = dynamic_cast<BvhLeaf *>(intersect)->GetActiveNode(); 1846 else 1847 activeNode = intersect; 1845 1848 1846 1849 if (!activeNode->Mailed())
Note: See TracChangeset
for help on using the changeset viewer.