Ignore:
Timestamp:
09/03/08 01:57:45 (16 years ago)
Author:
mattausch
Message:

improved shadow mapping

File:
1 edited

Legend:

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

    r2895 r2897  
    7777mAxis(-1),  
    7878mDepth(0),  
    79 mLastRenderedFrame(-999), 
    8079mFirst(-1),  
    8180mLast(-1), 
     
    9190                mPlaneMask[i] = 0; 
    9291                mPreferredPlane[i]= 0; 
     92                mLastRenderedFrame[i] = -1; 
    9393        } 
    9494} 
     
    105105        { 
    106106                mVisibility[i].Reset(); 
    107         } 
    108  
    109         mLastRenderedFrame = -999; 
     107                mLastRenderedFrame[i] = -1; 
     108                mPlaneMask[i] = 0; 
     109                mPreferredPlane[i]= 0; 
     110        } 
    110111} 
    111112 
     
    179180void Bvh::Init() 
    180181{ 
    181         mCamera = NULL; 
    182182        mRoot = NULL; 
    183183        mVertices = NULL; 
     
    364364 
    365365 
    366 void Bvh::InitFrame() 
     366void Bvh::InitFrame(Camera *cam) 
    367367{ 
    368368        // = 0011 1111 which means that at the beginning, all six planes have to frustum culled 
    369369        mRoot->mPlaneMask[BvhNode::sCurrentState] = 0x3f; 
    370370 
    371         mCamera->CalcFrustum(sFrustum); 
     371        cam->CalcFrustum(sFrustum); 
    372372        sFrustum.CalcNPVertexIndices(sClipPlaneAABBVertexIndices); 
    373373 
    374374        // store near plane 
    375         sNearPlane = Plane3(mCamera->GetDirection(), mCamera->GetPosition()); 
     375        sNearPlane = Plane3(cam->GetDirection(), cam->GetPosition()); 
    376376} 
    377377 
Note: See TracChangeset for help on using the changeset viewer.