Changeset 1165 for GTP/trunk/Lib
- Timestamp:
- 07/27/06 17:08:21 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
r1163 r1165 19 19 20 20 #include <stack> 21 22 #include "OgreKdTreeHierarchyInterface.h" 21 23 22 24 namespace Ogre … … 339 341 340 342 public: 343 friend class Ogre::KdTreeHierarchyInterface; 344 341 345 typedef KdTree::Leaf * LeafPtr; 342 346 typedef std::set<LeafPtr> LeafSet; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h
r1163 r1165 11 11 #define _KdTreeSceneManager_H__ 12 12 13 #include <OgreKdTreeHierarchyInterface.h> 13 14 #include <OgreSceneManager.h> 14 15 #include "OgreKdTree.h" 16 #include "VisibilityManager.h" 17 18 #define KDTREE_MAX_DEPTH 20 15 19 16 20 namespace Ogre … … 23 27 { 24 28 public: 25 KdTreeSceneManager(const String& name );29 KdTreeSceneManager(const String& name, GtpVisibility::VisibilityManager *vm); 26 30 //KdTreeSceneManager(const String& name, int maxdepth); 27 31 ~KdTreeSceneManager(void); … … 54 58 SceneManager::clearScene(); 55 59 } 60 56 61 protected: 62 GtpVisibility::VisibilityManager *mVisibilityManager; 63 64 KdTreeHierarchyInterface *mHierarchyInterface; 57 65 58 66 int mMaxDepth; … … 76 84 protected: 77 85 void initMetaData(void) const; 86 GtpVisibility::VisibilityManager *visManager; 78 87 public: 79 KdTreeSceneManagerFactory(void) {}; 88 KdTreeSceneManagerFactory(GtpVisibility::VisibilityManager * vm) 89 { 90 visManager = vm; 91 }; 80 92 ~KdTreeSceneManagerFactory(void) {}; 81 93 /// Factory type name -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj
r1163 r1165 273 273 </File> 274 274 <File 275 RelativePath="..\include\OgreKdTreeHierarchyInterface.h"> 276 </File> 277 <File 275 278 RelativePath="..\include\OgreKdTreeSceneManager.h"> 276 279 </File> … … 284 287 <File 285 288 RelativePath="..\src\OgreKdTree.cpp"> 289 </File> 290 <File 291 RelativePath="..\src\OgreKdTreeHierarchyInterface.cpp"> 286 292 </File> 287 293 <File -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
r1163 r1165 18 18 namespace Ogre 19 19 { 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) 39 22 { 40 23 // Replace root node with my node … … 44 27 mSceneRoot->_notifyRootNode(); 45 28 46 mMaxDepth = maxdepth;29 mMaxDepth = KDTREE_MAX_DEPTH; 47 30 mShowBoxes = false; 48 31 … … 50 33 OGRE_DELETE(mKdTree); 51 34 52 mBuildMethod = KdTree::KDBM_RECURSIVE;53 //mBuildMethod = KdTree::KDBM_PRIORITYQUEUE;35 //mBuildMethod = KdTree::KDBM_RECURSIVE; 36 mBuildMethod = KdTree::KDBM_PRIORITYQUEUE; 54 37 #ifdef KDTREE_DEBUG 55 38 mHighlighLevel = 0; 56 39 mShowAllBoxes = false; 57 40 #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; 58 53 } 59 54 … … 310 305 mMetaData.typeName = FACTORY_TYPE_NAME; 311 306 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) 313 308 mMetaData.worldGeometrySupported = false; 314 309 } … … 317 312 const String& instanceName) 318 313 { 319 return new KdTreeSceneManager(instanceName );314 return new KdTreeSceneManager(instanceName, visManager); 320 315 } 321 316 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilitySceneManagerDll.cpp
r1163 r1165 54 54 //visibilityTerrainPlugin = new VisibilityTerrainSceneManagerFactory(visManager); 55 55 occlusionCullingPlugin = new OcclusionCullingSceneManagerFactory(visManager); 56 kdTreeFactory = new KdTreeSceneManagerFactory( );56 kdTreeFactory = new KdTreeSceneManagerFactory(visManager); 57 57 // Construct listener manager singleton 58 58 new TerrainPageSourceListenerManager(); -
GTP/trunk/Lib/Vis/shared/scripts/GtpVisibility.sln
r1163 r1165 40 40 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestKdTree", "..\..\..\..\App\Demos\Vis\KdTreeDemo\OGRE\scripts\TestKdTree.vcproj", "{17F2C6F9-6101-430E-ABF4-71383868EF24}" 41 41 ProjectSection(ProjectDependencies) = postProject 42 {80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436} 43 {7319E499-473D-4CE5-9983-725D6E68A55D} = {7319E499-473D-4CE5-9983-725D6E68A55D} 42 44 EndProjectSection 43 45 EndProject
Note: See TracChangeset
for help on using the changeset viewer.