Ignore:
Timestamp:
04/02/07 11:59:11 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • OGRE/trunk/ogre_changes/Ogre1.2/PlugIns/OctreeSceneManager/src/OgreOctree.cpp

    r2257 r2308  
    8787      mHalfSize( 0, 0, 0 ) 
    8888#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    89         , mLastVisited(0), mVisible(false), mLastRendered(-1), mFullyVisible(false) 
     89        , mLastVisited(0), mVisible(false), mLastRendered(-1) 
     90        , mNumLeaves(1), mNumVisibleLeaves(0) 
     91        , mFullyVisible(false) 
    9092#endif //GTP_VISIBILITY_MODIFIED_OGRE 
    9193{ 
     
    105107 
    106108    mNumNodes = 0; 
     109 
     110#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     111        // recursively update number of children 
     112        if (0) _incNumChildren(); 
     113#endif; 
    107114} 
    108115 
     
    214221bool Octree::isOctreeFullyVisible() 
    215222{ 
     223        // all childrens are visible 
     224#if 0 
     225        return mNumChildren == mNumVisibleChildren; 
     226#else 
    216227        return mFullyVisible; 
    217 } 
    218 //-----------------------------------------------------------------------        
     228#endif 
     229} 
     230//-----------------------------------------------------------------------        
     231float Octree::getVisibilityRatio() 
     232{ 
     233        // all childrens are visible 
     234        return (float)mNumVisibleLeaves / (float)mNumLeaves; 
     235} 
     236//----------------------------------------------------------------------- 
     237void Octree::setNumVisibleLeaves(int leaves) 
     238{ 
     239        int mNumVisibleLeaves = leaves; 
     240} 
     241//----------------------------------------------------------------------- 
     242int Octree::getNumVisibleLeaves() 
     243{ 
     244        return mNumVisibleLeaves; 
     245} 
     246//----------------------------------------------------------------------- 
     247void Octree::setNumLeaves(int leaves) 
     248{ 
     249        mNumLeaves = leaves; 
     250} 
     251//----------------------------------------------------------------------- 
     252int Octree::getNumLeaves() 
     253{ 
     254        return mNumLeaves; 
     255} 
     256//----------------------------------------------------------------------- 
    219257Octree *Octree::getParent() 
    220258{ 
     
    267305                mParent->_updateBounds(); 
    268306        } 
    269  } 
     307} 
     308 
     309 
     310void Octree::_incNumChildren() 
     311{ 
     312/*      ++ mNumChildren; 
     313 
     314        if (mParent)     
     315        { 
     316                mParent->_incNumChildren(); 
     317        }*/ 
     318} 
    270319 
    271320#endif //GTP_VISIBILITY_MODIFIED_OGRE 
Note: See TracChangeset for help on using the changeset viewer.