Ignore:
Timestamp:
03/18/07 01:27:51 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvHierarchyInterface.h

    r2258 r2259  
    9797        void TraverseNode2(GtpVisibility::HierarchyNode *node) {} 
    9898        bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const { return false;} 
     99        GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *root) { return NULL;} 
    99100}; 
    100101 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeHierarchyInterface.h

    r2258 r2259  
    9696        void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const {} 
    9797 
    98         void TraverseNode2(GtpVisibility::HierarchyNode *node); 
     98        void TraverseNode2(GtpVisibility::HierarchyNode *node) {} 
    9999 
    100         HierarchyNode *GetRandomLeaf() { return NULL;} 
     100        GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *root) { return NULL;} 
    101101 
    102102        bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const { return false;} 
     103 
    103104}; 
    104105 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h

    r2258 r2259  
    5555        void TraverseNode2(GtpVisibility::HierarchyNode *node); 
    5656 
    57         HierarchyNode *GetRandomLeaf(); 
     57        GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *node); 
    5858 
    5959        bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const; 
    6060 
     61        void RenderNodeRecursive(GtpVisibility::HierarchyNode *node); 
     62 
     63 
    6164protected: 
     65 
    6266        /** Returns pointer to the bounding box of the node. 
    6367                @param node current hierarchy node 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreSceneNodeHierarchyInterface.h

    r2258 r2259  
    4848        void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const {} 
    4949        void TraverseNode2(GtpVisibility::HierarchyNode *node) {} 
    50         HierarchyNode *GetRandomLeaf() { return NULL;} 
     50        GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *root) { return NULL;} 
    5151        bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const { return false;} 
    5252 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp

    r2258 r2259  
    5151} 
    5252//----------------------------------------------------------------------- 
    53 HierarchyNode *OctreeHierarchyInterface::GetRandomLeaf()  
     53GtpVisibility::HierarchyNode *OctreeHierarchyInterface::GetRandomLeaf(GtpVisibility::HierarchyNode *root)  
    5454{  
    55         return NULL; 
    56 } 
    57 //----------------------------------------------------------------------- 
    58 bool OctreeHierarchyInterface::GIsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const 
    59 { 
    60         return static_cast<Octree *>(node)->isOctreeFullyVisible(); 
     55        if (IsLeaf(root)) 
     56                return root; 
     57 
     58        Octree *octree = static_cast<Octree *>(root); 
     59 
     60        int mask = (int) (rand() * 8); 
     61         
     62        // random decision 
     63        Octree *child = octree->mChildren[mask & 1][mask & 2][mask & 3]; 
     64 
     65        return GetRandomLeaf(child); 
    6166} 
    6267//----------------------------------------------------------------------- 
     
    214219} 
    215220//----------------------------------------------------------------------- 
     221void OctreeHierarchyInterface::RenderNodeRecursive(GtpVisibility::HierarchyNode *node) 
     222{ 
     223#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     224        Octree *octant = static_cast<Octree *>(node); 
     225 
     226        if (octant->lastRendered() != mFrameId) 
     227        { 
     228                octant->setLastRendered(mFrameId); 
     229                OctreeSceneManager *ocm =  
     230                        static_cast<OctreeSceneManager *>(mSceneManager); 
     231 
     232                ocm->_renderOctantRecursive(mCamera,  
     233                                                                        octant,  
     234                                                                        mOnlyShadowCasters,  
     235                                                                        mLeavePassesInQueue); 
     236 
     237                mVisibleNodes.push_back(node); 
     238        } 
     239#endif   
     240} 
     241//----------------------------------------------------------------------- 
    216242bool OctreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const 
    217243{ 
     
    223249} 
    224250//----------------------------------------------------------------------- 
     251bool OctreeHierarchyInterface::IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const 
     252{ 
     253#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     254        return static_cast<Octree *>(node)->isOctreeFullyVisible(); 
     255#else 
     256        return true; 
     257#endif 
     258} 
     259//----------------------------------------------------------------------- 
    225260unsigned int OctreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 
    226261{ 
Note: See TracChangeset for help on using the changeset viewer.