Ignore:
Timestamp:
03/23/07 01:40:24 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp

    r2281 r2283  
    6262         
    6363        std::vector<Octree *> nodes; 
    64  
    65         //LogManager::getSingleton().logMessage("***"); 
     64        nodes.reserve(8); 
     65 
    6666        for (int i = 0; i < 8; ++ i) 
    6767        { 
     
    7070                int z = i & 1; 
    7171         
     72                //std::stringstream d; d << x << " " << y << " " << z; 
     73                //Ogre::LogManager::getSingleton().logMessage(d.str()); 
     74 
    7275                if ((child = octree->mChildren[x][y][z]) != NULL) 
    7376                { 
     
    7679        } 
    7780 
     81        //std::stringstream str; str << "nodes: " << nodes.size(); 
     82        //Ogre::LogManager::getSingleton().logMessage(str.str()); 
     83 
    7884        if (nodes.empty()) 
    7985                return NULL; 
    8086 
    81         int r = (int) (rand() * (float)nodes.size()); 
     87        int r = (int)(((float)rand() / RAND_MAX) * ((float)nodes.size() - 0.5f)); 
     88 
     89        //std::stringstream str2; 
     90        //str2 << "rand: " << r; 
     91        //Ogre::LogManager::getSingleton().logMessage(str2.str()); 
    8292 
    8393        return GetRandomLeaf(nodes[r]); 
     
    101111        if (!octree->mNodes.empty()) 
    102112        { 
     113                RenderNodeRecursive(node); 
     114        } 
     115 
     116/* 
    103117                // render everything from here 
    104118                if (octree->isOctreeFullyVisible()) 
     
    133147                        mDistanceQueue->push(nextChild); 
    134148        } 
     149        */ 
    135150} 
    136151//----------------------------------------------------------------------- 
     
    206221         
    207222        Octree *nextChild; 
    208         //LogManager::getSingleton().logMessage("***"); 
     223         
    209224        for (int i = 0; i < 8; ++ i) 
    210225        { 
     
    212227                int y = (i & 2) / 2; 
    213228                int z = i & 1; 
    214                 Ogre::LogManager::getSingleton().logMessage("y"); 
    215                 //std::stringstream d; d << "x " << x << " y " << y << " z " << z; 
    216                 //LogManager::getSingleton().logMessage(d.str()); 
    217  
    218                 if ((nextChild = octant->mChildren[x][y][z]) != NULL) 
     229                 
     230                        if ((nextChild = octant->mChildren[x][y][z]) != NULL) 
    219231                { 
    220232                        DetermineFullVisibility(nextChild); 
Note: See TracChangeset for help on using the changeset viewer.