Ignore:
Timestamp:
11/21/05 18:51:12 (19 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp

    r422 r425  
    583583} 
    584584 
    585 bool X3dExporter::ExportVspKdTree(const VspKdTree &tree) 
    586 { 
    587          /*if (mExportRayDensity) {       
    588          return ExportKdTreeRayDensity(tree); }*/ 
     585bool X3dExporter::ExportVspKdTree(const VspKdTree &tree, const int maxPvs) 
     586{ 
     587         //if (mExportRayDensity) {       
     588         //return ExportKdTreeRayDensity(tree); } 
    589589 
    590590        stack<VspKdTreeNode *> tStack; 
     
    592592        tStack.push(tree.GetRoot()); 
    593593 
    594         Mesh *mesh = new Mesh; 
    595    
     594        //Mesh *mesh = new Mesh; 
     595   
     596        if (maxPvs > 0) 
     597                mUseForcedMaterial = true; 
     598 
    596599        while (!tStack.empty())  
    597600        { 
     
    601604                AxisAlignedBox3 box = tree.GetBBox(node); 
    602605 
     606                Mesh *mesh = new Mesh; 
     607 
    603608                // add 6 vertices of the box 
    604609                int index = (int)mesh->mVertices.size(); 
    605     
     610 
    606611                for (int i=0; i < 8; ++ i)  
    607612                { 
     
    619624                mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 
    620625 
     626                if (maxPvs > 0) 
     627                { 
     628            mForcedMaterial.mDiffuseColor.b = 1.0f; 
     629                        const float importance = maxPvs; 
     630                        //float importance = (float)(*it)->GetPvs().GetSize() / (float)maxPvs; 
     631 
     632                        mForcedMaterial.mDiffuseColor.r = importance; 
     633                        mForcedMaterial.mDiffuseColor.g = 1.0f - mForcedMaterial.mDiffuseColor.r; 
     634                } 
     635 
     636                ExportMesh(mesh); 
     637                DEL_PTR(mesh); 
     638 
    621639        if (!node->IsLeaf())  
    622640                { 
     
    627645        } 
    628646   
    629         ExportMesh(mesh); 
    630         DEL_PTR(mesh); 
     647        //ExportMesh(mesh); 
     648        //DEL_PTR(mesh); 
    631649 
    632650        return true; 
Note: See TracChangeset for help on using the changeset viewer.