Ignore:
Timestamp:
11/15/06 16:07:29 (18 years ago)
Author:
mattausch
Message:

bvhnode is now derived from Intersectable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp

    r1740 r1758  
    7979        We eliminate already accounted bvh nodes and objects using mailboxing.  
    8080*/ 
    81 static float EvalBvhNodeContribution(BvhIntersectable *bvhobj) 
     81static float EvalBvhNodeContribution(BvhNode *bvhObj) 
    8282{ 
    83         BvhLeaf *leaf = bvhobj->GetItem(); 
    84         BvhNode *node = leaf->GetActiveNode(); 
     83        BvhNode *node; 
     84 
     85        // hack for choosing which node to account for 
     86        if (bvhObj->IsLeaf()) 
     87                node = dynamic_cast<BvhLeaf *>(bvhObj)->GetActiveNode(); 
     88        else 
     89                node = bvhObj; 
    8590 
    8691        // early exit 
    87         if (node == leaf)        
    88         { 
     92        if (node->IsLeaf())      
     93        {        
     94                BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 
    8995                // objects already accounted for 
    9096                if (leaf->Mailed()) 
     
    112118                        if (node->IsLeaf()) 
    113119                        { 
    114                                 leaf = dynamic_cast<BvhLeaf *>(node); 
     120                                BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 
    115121 
    116122                                // add #objects exclusivly in this node 
     
    156162                        case Intersectable::BVH_INTERSECTABLE: 
    157163                                { 
    158                                         BvhIntersectable *bvhObj = dynamic_cast<BvhIntersectable *>(obj); 
     164                                        BvhNode *bvhObj = dynamic_cast<BvhNode *>(obj); 
    159165                                        pvs += EvalBvhNodeContribution(bvhObj); 
    160166                                        break; 
Note: See TracChangeset for help on using the changeset viewer.