Ignore:
Timestamp:
07/27/06 17:08:21 (18 years ago)
Author:
szydlowski
Message:

Started implementing the hierarchy interface for the kdtree scene manager

Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src
Files:
1 added
2 edited

Legend:

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

    r1163 r1165  
    1818namespace Ogre 
    1919{ 
    20         KdTreeSceneManager::KdTreeSceneManager(const String& name): 
    21                 SceneManager(name) 
    22         { 
    23                 int maxdepth = 20; 
    24                 mKdTree = 0; 
    25                 init(maxdepth); 
    26         } 
    27  
    28         KdTreeSceneManager::~KdTreeSceneManager(void) 
    29         { 
    30                 delete mKdTree; 
    31         } 
    32  
    33         const String& KdTreeSceneManager::getTypeName(void) const 
    34         { 
    35                 return KdTreeSceneManagerFactory::FACTORY_TYPE_NAME; 
    36         } 
    37  
    38         void KdTreeSceneManager::init(int maxdepth) 
     20        KdTreeSceneManager::KdTreeSceneManager(const String& name, GtpVisibility::VisibilityManager *vm): 
     21                SceneManager(name), mKdTree(0), mVisibilityManager(vm) 
    3922        { 
    4023                // Replace root node with my node 
     
    4427                mSceneRoot->_notifyRootNode(); 
    4528 
    46                 mMaxDepth = maxdepth; 
     29                mMaxDepth = KDTREE_MAX_DEPTH; 
    4730                mShowBoxes = false; 
    4831 
     
    5033                OGRE_DELETE(mKdTree); 
    5134 
    52                 mBuildMethod = KdTree::KDBM_RECURSIVE; 
    53                 //mBuildMethod = KdTree::KDBM_PRIORITYQUEUE; 
     35                //mBuildMethod = KdTree::KDBM_RECURSIVE; 
     36                mBuildMethod = KdTree::KDBM_PRIORITYQUEUE; 
    5437#ifdef KDTREE_DEBUG 
    5538                mHighlighLevel = 0; 
    5639                mShowAllBoxes = false; 
    5740#endif 
     41 
     42                mHierarchyInterface = new KdTreeHierarchyInterface(this, mDestRenderSystem); 
     43        } 
     44 
     45        KdTreeSceneManager::~KdTreeSceneManager(void) 
     46        { 
     47                delete mKdTree; 
     48        } 
     49 
     50        const String& KdTreeSceneManager::getTypeName(void) const 
     51        { 
     52                return KdTreeSceneManagerFactory::FACTORY_TYPE_NAME; 
    5853        } 
    5954 
     
    310305                mMetaData.typeName = FACTORY_TYPE_NAME; 
    311306                mMetaData.description = "Scene manager that organises the scene based on a kd-tree"; 
    312                 mMetaData.sceneTypeMask = ST_GENERIC; // support generic scenes (so far) 
     307                mMetaData.sceneTypeMask = 0xFFFF; // support all types of scenes (hopefully) 
    313308                mMetaData.worldGeometrySupported = false; 
    314309        } 
     
    317312                const String& instanceName) 
    318313        { 
    319                 return new KdTreeSceneManager(instanceName); 
     314                return new KdTreeSceneManager(instanceName, visManager); 
    320315        } 
    321316        //----------------------------------------------------------------------- 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilitySceneManagerDll.cpp

    r1163 r1165  
    5454        //visibilityTerrainPlugin = new VisibilityTerrainSceneManagerFactory(visManager); 
    5555        occlusionCullingPlugin = new OcclusionCullingSceneManagerFactory(visManager); 
    56         kdTreeFactory = new KdTreeSceneManagerFactory(); 
     56        kdTreeFactory = new KdTreeSceneManagerFactory(visManager); 
    5757        // Construct listener manager singleton 
    5858        new TerrainPageSourceListenerManager(); 
Note: See TracChangeset for help on using the changeset viewer.