Changeset 1707 for GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp
- Timestamp:
- 11/01/06 23:20:53 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp
r1703 r1707 79 79 We eliminate already accounted bvh nodes and objects using mailboxing. 80 80 */ 81 static int EvalBvhNodeContribution(BvhIntersectable *bvhobj)81 static float EvalBvhNodeContribution(BvhIntersectable *bvhobj) 82 82 { 83 BvhNode *node= bvhobj->GetItem(); 83 BvhLeaf *leaf = bvhobj->GetItem(); 84 BvhNode *node = leaf->GetActiveNode(); 84 85 85 86 // early exit 86 if (node ->IsLeaf())87 if (node == leaf) 87 88 { 88 89 // objects already accounted for 89 if ( node->Mailed())90 if (leaf->Mailed()) 90 91 return 0; 91 92 92 node->Mail(); 93 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 94 return (int)leaf->mObjects.size(); 93 leaf->Mail(); 94 return BvHierarchy::EvalAbsCost(leaf->mObjects); 95 95 } 96 96 97 97 // compute leaf pvs 98 int pvs = 0;98 float pvs = 0; 99 99 stack<BvhNode *> tStack; 100 tStack.push( bvhobj->GetItem());100 tStack.push(node); 101 101 102 102 while (!tStack.empty()) 103 103 { 104 BvhNode *node = tStack.top();104 node = tStack.top(); 105 105 tStack.pop(); 106 106 … … 112 112 if (node->IsLeaf()) 113 113 { 114 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node);114 leaf = dynamic_cast<BvhLeaf *>(node); 115 115 116 116 // add #objects exclusivly in this node … … 132 132 133 133 134 int ObjectPvs::CountObjectsInPvs() const134 float ObjectPvs::EvalPvsCost() const 135 135 { 136 int pvs = 0;136 float pvs = 0; 137 137 138 138 Intersectable::NewMail();
Note: See TracChangeset
for help on using the changeset viewer.