Ignore:
Timestamp:
03/22/07 11:48:21 (17 years ago)
Author:
mattausch
Message:

worked on randomupdatemanager

Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
Files:
7 edited

Legend:

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

    r2259 r2278  
    1616         
    1717        /** Sets the number of nodes in this octree  
    18                 @remark do not confuse this with the OctreeNode class which is derived from SceneNode 
     18                @remark do not confuse this with the OctreeNode class  
     19                which is derived from SceneNode. 
    1920                @param num number of nodes in the octree 
    2021        */ 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r2258 r2278  
    19281928 
    19291929                ivReader.buildTree(this, node); 
    1930                  
    19311930                ivReader.collapse(); 
    1932  
     1931                 
    19331932                std::stringstream d;  
    19341933                d << "loaded " << filename << " in " << timer->getMilliseconds() * 1e-3 << " secs"; 
     
    19371936                PlatformManager::getSingleton().destroyTimer(timer); 
    19381937 
    1939                 //-- bake into static geometry 
    19401938                /*if (USE_STATIC_GEOMETRY) 
    19411939                { 
     1940                        //-- bake into static geometry 
    19421941                        BakeSceneIntoStaticGeometry("staticVienna", "Vienna"); 
    19431942                }*/ 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp

    r2259 r2278  
    5858        Octree *octree = static_cast<Octree *>(root); 
    5959 
    60         int mask = (int) (rand() * 8); 
     60        int mask = (int) (rand() * 8.0f); 
    6161         
    6262        // random decision 
    63         Octree *child = octree->mChildren[mask & 1][mask & 2][mask & 3]; 
     63        Octree *child = NULL; 
     64         
     65        while (!child) 
     66                child = octree->mChildren[(mask & 4) / 4][(mask & 2) / 2][mask & 1]; 
    6467 
    6568        return GetRandomLeaf(child); 
     
    173176        { 
    174177                octant->setOctreeFullyVisible(octant->isOctreeVisible()); 
     178                         
    175179                return; 
    176180        } 
    177181 
    178         octant->setOctreeFullyVisible(false); 
    179  
     182        octant->setOctreeFullyVisible(true); 
     183         
    180184        Octree *nextChild; 
    181  
     185        //LogManager::getSingleton().logMessage("***"); 
    182186        for (int i = 0; i < 8; ++ i) 
    183187        { 
    184                 int x = i & 4; 
    185                 int y = i & 2; 
     188                int x = (i & 4) / 4; 
     189                int y = (i & 2) / 2; 
    186190                int z = i & 1; 
     191 
     192                //std::stringstream d; d << "x " << x << " y " << y << " z " << z; 
     193                //LogManager::getSingleton().logMessage(d.str()); 
    187194 
    188195                if ((nextChild = octant->mChildren[x][y][z]) != NULL) 
    189196                { 
    190197                        DetermineFullVisibility(nextChild); 
     198                        // this leaf is not fully visible => break 
    191199                        if (!nextChild->isOctreeFullyVisible()) 
    192                         return; 
     200                                octant->setOctreeFullyVisible(false); 
    193201                } 
    194202        } 
    195  
    196         // all children fully visible => pull up 
    197         octant->setOctreeFullyVisible(true); 
    198203} 
    199204//----------------------------------------------------------------------- 
     
    295300        } 
    296301 
    297         //static_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box); 
    298302        static_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box); 
    299303} 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp

    r2254 r2278  
    9595        static RenderOperation ro; 
    9696 
    97         //LogManager::getSingleton().logMessage("here66"); 
    9897        SolidBoundingBox *solidBox = GetSolidBoundingBox(); 
    9998         
     
    182181        GtpVisibility::HierarchyNode *node,  
    183182        const bool wasVisible)  
    184 {//LogManager::getSingleton().logMessage("here6960"); 
     183{ 
    185184        // get next available test id 
    186185        GtpVisibility::OcclusionQuery *query = GetNextOcclusionQuery(); 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSceneContentGenerator.cpp

    r1264 r2278  
    157157                return false; 
    158158 
    159         //mSceneNodes.clear(); // reset list of objects 
    160  
    161         while (!ifstr.eof())  
     159        while (1) 
    162160        { 
    163161                ifstr.getline(line, 256); 
     162 
     163                if (ifstr.eof()) 
     164                        break; 
     165 
    164166                sscanf(line, "%s %f %f %f %f %f %f %f %f %f %f", objName,  
    165167                        &position.x, &position.y, &position.z, 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTerrainContentGenerator.cpp

    r164 r2278  
    4343        return false; 
    4444} 
     45 
    4546 
    4647/*******************************************************/ 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj

    r2255 r2278  
    2626                                RuntimeLibrary="3" 
    2727                                EnableFunctionLevelLinking="TRUE" 
    28                                 RuntimeTypeInfo="TRUE" 
     28                                RuntimeTypeInfo="FALSE" 
    2929                                UsePrecompiledHeader="2" 
    3030                                WarningLevel="3" 
     
    113113                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;..\..\..\..\..\..\..\NonGTP\Zlib\lib;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\lib\$(ConfigurationName)&quot;" 
    114114                                ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def" 
    115                                 GenerateDebugInformation="FALSE" 
     115                                GenerateDebugInformation="TRUE" 
    116116                                SubSystem="2" 
    117117                                OptimizeReferences="2" 
Note: See TracChangeset for help on using the changeset viewer.