Ignore:
Timestamp:
06/27/08 01:43:45 (16 years ago)
Author:
mattausch
Message:

friendly culling debug version with timers, no materials

File:
1 edited

Legend:

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

    r2792 r2800  
    5252                /// if the node is newly processed with no prior history available 
    5353                bool mIsNew; 
     54                /// the frame this node was last queried 
     55                int mLastQueriedFrame; 
    5456        }; 
    5557 
     
    113115        inline void SetTurnedVisibleFrame(int turnedVisibleFrame); 
    114116 
    115         inline int GetLastTestedFrame(); 
    116         inline void SetLastTestedFrame(int lastTested); 
     117        inline int GetLastQueriedFrame() const; 
     118        inline void SetLastQueriedFrame(int lastTested); 
    117119         
    118120        inline bool IsViewFrustumCulled() const; 
     
    155157        ///////////// 
    156158         
    157         /// some flags 
    158         //int mFlags; 
    159159        /// the depth of this node 
    160160        unsigned char mDepth; 
     
    217217 
    218218 
     219 
    219220///////////////// 
    220221//-- public inline functions 
    221222 
     223 
    222224int BvhNode::GetLastVisitedFrame() const  
    223225{  
     
    268270 
    269271 
    270 void BvhNode::SetViewFrustumCulled(const bool frustumCulled)  
     272void BvhNode::SetViewFrustumCulled(bool frustumCulled)  
    271273{  
    272274        mVisibility.mIsFrustumCulled = frustumCulled;  
     
    280282 
    281283 
    282 void BvhNode::SetIsNew(const bool isNew)  
     284void BvhNode::SetIsNew(bool isNew)  
    283285{  
    284286        mVisibility.mIsNew = isNew;  
     
    320322        return mVisibility.mAssumedVisibleFrameId; 
    321323} 
     324 
     325 
     326int BvhNode::GetLastQueriedFrame() const 
     327{ 
     328        return mVisibility.mLastQueriedFrame; 
     329} 
     330 
     331 
     332void BvhNode::SetLastQueriedFrame(int lastTested) 
     333{ 
     334        mVisibility.mLastQueriedFrame = lastTested; 
     335} 
     336 
    322337 
    323338 
     
    429444        */ 
    430445        inline int GetNumLeaves() const { return mNumNodes / 2 + 1;} 
     446        /** Returns number of 'virtual' nodes in the hierarchy, i.e. 
     447                the number of nodes actually used for traversal. 
     448        */ 
     449        int GetNumVirtualNodes() const  { return mNumVirtualNodes; } 
     450        /** Returns number of bvh leaves. 
     451        */ 
     452        inline int GetNumVirtualLeaves() const { return mNumVirtualNodes / 2 + 1;} 
    431453        /** Returns root node of the bvh. 
    432454        */ 
     
    512534        */ 
    513535        void SetVirtualLeaves(int numTriangles); 
    514  
     536         
    515537 
    516538        //////// 
     
    526548        void SetAreaRatioThresholdForTestingChildren(float ratio); 
    527549 
     550 
     551        //////////////////////////// 
     552 
    528553        /** Returns stats. 
    529554        */ 
    530555        const BvhStats &GetBvhStats() const { return mBvhStats; } 
    531         /** Returns number of 'virtual' nodes in the hierarchy, i.e. 
    532                 the number of nodes actually used for traversal. 
    533         */ 
    534         int GetNumVirtualNodes() const  { return mNumVirtualNodes; } 
    535556        /** Render wireframe bvh for visualization purpose. 
    536557        */ 
Note: See TracChangeset for help on using the changeset viewer.