Ignore:
Timestamp:
06/18/08 17:33:16 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/CHC_revisited/Bvh.cpp

    r2770 r2771  
    124124Bvh::Bvh(): 
    125125mCamera(NULL),  
    126 mFrameId(-1),  
    127126mRoot(NULL),  
    128127mVertices(NULL), 
     
    138137Bvh::Bvh(const SceneEntityContainer &entities): 
    139138mCamera(NULL),  
    140 mFrameId(-1),  
    141139mRoot(NULL),  
    142140mVertices(NULL), 
     
    349347 
    350348 
    351 void Bvh::InitFrame(Camera *camera, int currentFrameId) 
     349void Bvh::InitFrame() 
    352350{ 
    353351        // = 0011 1111 which means that at the beginning, all six planes have to frustum culled 
    354352        mRoot->mPlaneMask = 0x3f; 
    355         mCamera = camera; 
    356  
    357         mFrameId = currentFrameId; 
    358353 
    359354        mCamera->CalcFrustum(sFrustum); 
     
    809804int Bvh::Render(BvhNode *node, RenderState *state) 
    810805{ 
    811         //cout << "r " << node->mFirst << " " <<  node->mLast << endl; 
    812  
    813         int rendered = 0; 
     806        int renderedTriangles = 0; 
    814807 
    815808        for (int i = node->mFirst; i <= node->mLast; ++ i) 
    816809        { 
    817                 if (mGeometry[i]->GetLastRendered() != mFrameId) 
    818                 { 
    819                         mGeometry[i]->Render(state); 
    820                         mGeometry[i]->SetLastRendered(mFrameId); 
    821                         ++ rendered; 
    822                 } 
    823         } 
    824  
    825         return rendered; 
     810                renderedTriangles += mGeometry[i]->GetGeometry()->CountTriangles(); 
     811                mGeometry[i]->Render(state); 
     812        } 
     813 
     814        return renderedTriangles; 
    826815} 
    827816 
Note: See TracChangeset for help on using the changeset viewer.