Ignore:
Timestamp:
03/18/07 01:27:51 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.