Changeset 45 for trunk/VUT/OcclusionCullingSceneManager/src
- Timestamp:
- 04/13/05 00:36:07 (20 years ago)
- Location:
- trunk/VUT/OcclusionCullingSceneManager/src
- Files:
-
- 1 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingOctreeSceneManager.cpp
r44 r45 1 #include "OgreOcclusionCulling TerrainSceneManager.h"1 #include "OgreOcclusionCullingOctreeSceneManager.h" 2 2 #include "OgreMath.h" 3 3 #include "OgreIteratorWrappers.h" 4 4 #include "OgreRenderSystem.h" 5 5 #include "OgreCamera.h" 6 #include "OgreHardwareOcclusionQuery.h"7 #include "OgreSolidHalfBoundingBox.h"8 6 9 7 #include <windows.h> … … 11 9 namespace Ogre { 12 10 //----------------------------------------------------------------------- 13 OcclusionCulling TerrainSceneManager::OcclusionCullingTerrainSceneManager()11 OcclusionCullingOctreeSceneManager::OcclusionCullingOctreeSceneManager() 14 12 { 15 mOcclusionCulling TerrainSceneTraverser =16 new OcclusionCulling TerrainSceneTraverser(this, mDestRenderSystem);13 mOcclusionCullingOctreeSceneTraverser = 14 new OcclusionCullingOctreeSceneTraverser(this, mDestRenderSystem); 17 15 18 16 //mDisplayNodes = true; … … 22 20 } 23 21 //----------------------------------------------------------------------- 24 OcclusionCulling TerrainSceneManager::~OcclusionCullingTerrainSceneManager()22 OcclusionCullingOctreeSceneManager::~OcclusionCullingOctreeSceneManager() 25 23 { 26 delete mOcclusionCulling TerrainSceneTraverser;24 delete mOcclusionCullingOctreeSceneTraverser; 27 25 } 28 26 //----------------------------------------------------------------------- 29 void OcclusionCulling TerrainSceneManager::_renderVisibleObjects(void)27 void OcclusionCullingOctreeSceneManager::_renderVisibleObjects(void) 30 28 { 31 29 //-- render background … … 43 41 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 44 42 45 mOcclusionCulling TerrainSceneTraverser->setSceneRoot(mOctree);46 mOcclusionCulling TerrainSceneTraverser->renderScene(mCameraInProgress);43 mOcclusionCullingOctreeSceneTraverser->setSceneRoot(mOctree); 44 mOcclusionCullingOctreeSceneTraverser->renderScene(mCameraInProgress); 47 45 48 46 _deleteRenderedQueueGroups(); … … 55 53 } 56 54 //----------------------------------------------------------------------- 57 void OcclusionCulling TerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters)55 void OcclusionCullingOctreeSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 58 56 { 59 57 // must be empty because objects are found and rendered in an interleaved fashion … … 62 60 } 63 61 //----------------------------------------------------------------------- 64 void OcclusionCulling TerrainSceneManager::_updateSceneGraph(Camera* cam)62 void OcclusionCullingOctreeSceneManager::_updateSceneGraph(Camera* cam) 65 63 { 66 64 //char *msg = "now updating scenegraph\n"; OutputDebugString(msg); 67 //mOcclusionCulling TerrainSceneTraverser->preprocess();65 //mOcclusionCullingOctreeSceneTraverser->preprocess(); 68 66 69 mOcclusionCulling TerrainSceneTraverser->setNumSceneNodes((int)mSceneNodes.size());70 mOcclusionCulling TerrainSceneTraverser->setRenderSystem(mDestRenderSystem);67 mOcclusionCullingOctreeSceneTraverser->setNumSceneNodes((int)mSceneNodes.size()); 68 mOcclusionCullingOctreeSceneTraverser->setRenderSystem(mDestRenderSystem); 71 69 72 mOcclusionCulling TerrainSceneTraverser->setNumOctreeNodes(mNumOctreeNodes);70 mOcclusionCullingOctreeSceneTraverser->setNumOctreeNodes(mNumOctreeNodes); 73 71 74 TerrainSceneManager::_updateSceneGraph(cam);72 OctreeSceneManager::_updateSceneGraph(cam); 75 73 } 76 74 //----------------------------------------------------------------------- 77 bool OcclusionCulling TerrainSceneManager::setOption( const String & key, const void * val )75 bool OcclusionCullingOctreeSceneManager::setOption( const String & key, const void * val ) 78 76 { 79 return mOcclusionCulling TerrainSceneTraverser->setOption( key, val) || TerrainSceneManager::setOption( key, val );77 return mOcclusionCullingOctreeSceneTraverser->setOption( key, val) || OctreeSceneManager::setOption( key, val ); 80 78 } 81 79 //----------------------------------------------------------------------- 82 bool OcclusionCulling TerrainSceneManager::getOption( const String & key, void *val )80 bool OcclusionCullingOctreeSceneManager::getOption( const String & key, void *val ) 83 81 { 84 return mOcclusionCulling TerrainSceneTraverser->getOption( key, val) || TerrainSceneManager::getOption( key, val ) ;82 return mOcclusionCullingOctreeSceneTraverser->getOption( key, val) || OctreeSceneManager::getOption( key, val ) ; 85 83 } 86 84 //----------------------------------------------------------------------- 87 bool OcclusionCulling TerrainSceneManager::getOptionValues( const String & key, StringVector &refValueList )85 bool OcclusionCullingOctreeSceneManager::getOptionValues( const String & key, StringVector &refValueList ) 88 86 { 89 return TerrainSceneManager::getOptionValues( key, refValueList );87 return OctreeSceneManager::getOptionValues( key, refValueList ); 90 88 } 91 89 //----------------------------------------------------------------------- 92 bool OcclusionCulling TerrainSceneManager::getOptionKeys( StringVector & refKeys )90 bool OcclusionCullingOctreeSceneManager::getOptionKeys( StringVector & refKeys ) 93 91 { 94 return mOcclusionCulling TerrainSceneTraverser->getOptionKeys ( refKeys ) || TerrainSceneManager::getOptionKeys( refKeys );92 return mOcclusionCullingOctreeSceneTraverser->getOptionKeys ( refKeys ) || OctreeSceneManager::getOptionKeys( refKeys ); 95 93 } 96 94 //----------------------------------------------------------------------- 97 void OcclusionCulling TerrainSceneManager::_renderOctant(Camera *cam, Octree *octant)95 void OcclusionCullingOctreeSceneManager::_renderOctant(Camera *cam, Octree *octant) 98 96 { 99 97 //Add stuff to be rendered; … … 131 129 _deleteRenderedQueueGroups(); 132 130 } 133 //-----------------------------------------------------------------------134 /*unsigned int OcclusionCullingTerrainSceneManager::countNumOctrees(Octree *root)135 {136 unsigned int result = 1;137 138 for(int i=0; i<8; ++i)139 {140 Octree *nextChild = root->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1];141 142 if(nextChild != 0)143 result += countNumOctrees(nextChild);144 }145 146 return result;147 }*/148 131 } -
trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingSceneManagerDll.cpp
r37 r45 34 34 namespace Ogre { 35 35 36 OcclusionCullingDotSceneManager *occlusionPlugin; 36 // OcclusionCullingDotSceneManager *occlusionDotPlugin; 37 OcclusionCullingOctreeSceneManager *occlusionOctreePlugin; 37 38 OcclusionCullingTerrainSceneManager *occlusionTerrainPlugin; 38 39 HeightmapTerrainPageSource* heightmapTerrainPageSource; … … 42 43 { 43 44 // Create new scene manager 44 occlusionPlugin = new OcclusionCullingDotSceneManager(); 45 //occlusionDotPlugin = new OcclusionCullingDotSceneManager(); 46 occlusionOctreePlugin = new OcclusionCullingOctreeSceneManager(); 45 47 occlusionTerrainPlugin = new OcclusionCullingTerrainSceneManager(); 46 48 heightmapTerrainPageSource = new HeightmapTerrainPageSource(); … … 49 51 50 52 // Register 51 Root::getSingleton().setSceneManager( ST_GENERIC, occlusionPlugin ); 53 //Root::getSingleton().setSceneManager( ST_GENERIC, occlusionDotPlugin ); 54 Root::getSingleton().setSceneManager( ST_GENERIC, occlusionOctreePlugin ); 52 55 Root::getSingleton().setSceneManager( ST_EXTERIOR_CLOSE, occlusionTerrainPlugin ); 53 56 … … 57 60 { 58 61 delete heightmapTerrainPageSource; 59 delete occlusionPlugin; 62 //delete occlusionDotPlugin; 63 delete occlusionOctreePlugin; 60 64 delete occlusionTerrainPlugin; 61 65 }
Note: See TracChangeset
for help on using the changeset viewer.