Changeset 74 for trunk/VUT/Ogre
- Timestamp:
- 05/01/05 23:29:27 (20 years ago)
- Location:
- trunk/VUT/Ogre
- Files:
-
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h
r59 r74 26 26 void TraverseNode(GtpVisibility::HierarchyNode *node); 27 27 void RenderNode(GtpVisibility::HierarchyNode *node); 28 bool IsLeaf(GtpVisibility::HierarchyNode *node) ;29 bool HasGeometry(GtpVisibility::HierarchyNode *node) ;28 bool IsLeaf(GtpVisibility::HierarchyNode *node) const; 29 bool HasGeometry(GtpVisibility::HierarchyNode *node) const; 30 30 bool HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 31 GtpVisibility::HierarchyNode *node2) ;31 GtpVisibility::HierarchyNode *node2) const; 32 32 33 33 void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible); 34 void SetLastVisited(GtpVisibility::HierarchyNode *node, const int frameId); 34 void SetLastVisited(GtpVisibility::HierarchyNode *node, 35 const unsigned int frameId); 35 36 36 bool IsNodeVisible(GtpVisibility::HierarchyNode *node) ;37 int LastVisited(GtpVisibility::HierarchyNode *node);37 bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const; 38 unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const; 38 39 39 40 protected: -
trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h
r59 r74 33 33 void TraverseNode(GtpVisibility::HierarchyNode *node); 34 34 void RenderNode(GtpVisibility::HierarchyNode *node); 35 bool IsLeaf(GtpVisibility::HierarchyNode *node) ;36 bool HasGeometry(GtpVisibility::HierarchyNode *node) ;35 bool IsLeaf(GtpVisibility::HierarchyNode *node) const; 36 bool HasGeometry(GtpVisibility::HierarchyNode *node) const; 37 37 bool HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 38 GtpVisibility::HierarchyNode *node2) ;38 GtpVisibility::HierarchyNode *node2) const; 39 39 40 40 void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible); 41 void SetLastVisited(GtpVisibility::HierarchyNode *node, const int frameId);41 void SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId); 42 42 43 bool IsNodeVisible(GtpVisibility::HierarchyNode *node) ;44 int LastVisited(GtpVisibility::HierarchyNode *node);43 bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const; 44 unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const; 45 45 46 46 protected: -
trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h
r59 r74 19 19 SceneNodeHierarchyInterface(SceneManager *sm, RenderSystem *rsys); 20 20 21 bool IsLeaf(GtpVisibility::HierarchyNode *node) ;21 bool IsLeaf(GtpVisibility::HierarchyNode *node) const; 22 22 23 23 void TraverseNode(GtpVisibility::HierarchyNode *node); 24 24 void RenderNode(GtpVisibility::HierarchyNode *node); 25 25 void PullUpVisibility(GtpVisibility::HierarchyNode *node); 26 bool HasGeometry(GtpVisibility::HierarchyNode *node) ;26 bool HasGeometry(GtpVisibility::HierarchyNode *node) const; 27 27 bool HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 28 GtpVisibility::HierarchyNode *node2) ;28 GtpVisibility::HierarchyNode *node2) const; 29 29 30 30 void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible); 31 void SetLastVisited(GtpVisibility::HierarchyNode *node, const int frameId); 31 void SetLastVisited(GtpVisibility::HierarchyNode *node, 32 const unsigned int frameId); 32 33 33 bool IsNodeVisible(GtpVisibility::HierarchyNode *node) ;34 int LastVisited(GtpVisibility::HierarchyNode *node);34 bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const; 35 unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const; 35 36 36 37 AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node); -
trunk/VUT/Ogre/misc/OgreVisibilitySceneManager.def
r59 r74 1 LIBRARY Plugin_ OcclusionCullingSceneManager1 LIBRARY Plugin_VisibilitySceneManager 2 2 EXPORTS 3 3 dllStartPlugin -
trunk/VUT/Ogre/resources/VisibilityDemo.overlay
r59 r74 1 Example/ OcclusionCullingDemoOverlay1 Example/VisibilityDemoOverlay 2 2 { 3 3 zorder 500 4 4 // Stats block 5 container BorderPanel(Example/ Occlusion/OcclusionPanel)5 container BorderPanel(Example/Visibility/VisibilityPanel) 6 6 { 7 7 metrics_mode pixels … … 24 24 25 25 26 element TextArea(Example/ Occlusion/Algorithm)26 element TextArea(Example/Visibility/Algorithm) 27 27 { 28 28 metrics_mode pixels … … 37 37 colour_bottom 0.3 0.5 0.3 38 38 } 39 element TextArea(Example/ Occlusion/AlgorithmInfo)39 element TextArea(Example/Visibility/AlgorithmInfo) 40 40 { 41 41 metrics_mode pixels … … 51 51 } 52 52 53 element TextArea(Example/ Occlusion/Threshold)53 element TextArea(Example/Visibility/Threshold) 54 54 { 55 55 metrics_mode pixels … … 64 64 colour_bottom 0.3 0.5 0.3 65 65 } 66 element TextArea(Example/ Occlusion/ThresholdInfo)66 element TextArea(Example/Visibility/ThresholdInfo) 67 67 { 68 68 metrics_mode pixels … … 79 79 } 80 80 81 container BorderPanel(Example/ Occlusion/OcclusionStatsPanel)81 container BorderPanel(Example/Visibility/VisibilityStatsPanel) 82 82 { 83 83 metrics_mode pixels … … 87 87 top 5 88 88 width 450 89 height 10589 height 90 90 90 material Core/StatsBlockCenter 91 91 border_size 1 1 1 1 … … 100 100 border_bottomright_uv 0.9961 0.0039 1.0000 0.0000 101 101 102 element TextArea(Example/ Occlusion/FrustumCulledNodes)102 element TextArea(Example/Visibility/FrustumCulledNodes) 103 103 { 104 104 metrics_mode pixels … … 113 113 colour_bottom 0.3 0.5 0.3 114 114 } 115 element TextArea(Example/ Occlusion/FrustumCulledNodesInfo)116 { 117 metrics_mode pixels 118 left 180 119 top 5 120 width 90 121 height 30 122 font_name TrebuchetMSBold 123 char_height 16 124 caption : 125 colour_top 0.5 0.7 0.5 126 colour_bottom 0.3 0.5 0.3 127 } 128 element TextArea(Example/ Occlusion/QueryCulledNodes)115 element TextArea(Example/Visibility/FrustumCulledNodesInfo) 116 { 117 metrics_mode pixels 118 left 180 119 top 5 120 width 90 121 height 30 122 font_name TrebuchetMSBold 123 char_height 16 124 caption : 125 colour_top 0.5 0.7 0.5 126 colour_bottom 0.3 0.5 0.3 127 } 128 element TextArea(Example/Visibility/QueryCulledNodes) 129 129 { 130 130 metrics_mode pixels … … 139 139 colour_bottom 0.3 0.5 0.3 140 140 } 141 element TextArea(Example/ Occlusion/QueryCulledNodesInfo)142 { 143 metrics_mode pixels 144 left 180 145 top 20 146 width 90 147 height 30 148 font_name TrebuchetMSBold 149 char_height 16 150 caption : 151 colour_top 0.5 0.7 0.5 152 colour_bottom 0.3 0.5 0.3 153 } 154 element TextArea(Example/ Occlusion/TraversedNodes)141 element TextArea(Example/Visibility/QueryCulledNodesInfo) 142 { 143 metrics_mode pixels 144 left 180 145 top 20 146 width 90 147 height 30 148 font_name TrebuchetMSBold 149 char_height 16 150 caption : 151 colour_top 0.5 0.7 0.5 152 colour_bottom 0.3 0.5 0.3 153 } 154 element TextArea(Example/Visibility/TraversedNodes) 155 155 { 156 156 metrics_mode pixels … … 165 165 colour_bottom 0.3 0.5 0.3 166 166 } 167 element TextArea(Example/ Occlusion/TraversedNodesInfo)167 element TextArea(Example/Visibility/TraversedNodesInfo) 168 168 { 169 169 metrics_mode pixels … … 178 178 colour_bottom 0.3 0.5 0.3 179 179 } 180 element TextArea(Example/ Occlusion/SceneNodes)180 element TextArea(Example/Visibility/HierarchyNodes) 181 181 { 182 182 metrics_mode pixels … … 187 187 font_name TrebuchetMSBold 188 188 char_height 16 189 caption SceneNodes190 colour_top 0.5 0.7 0.5 191 colour_bottom 0.3 0.5 0.3 192 } 193 element TextArea(Example/ Occlusion/SceneNodesInfo)189 caption Hierarchy Nodes 190 colour_top 0.5 0.7 0.5 191 colour_bottom 0.3 0.5 0.3 192 } 193 element TextArea(Example/Visibility/HierarchyNodesInfo) 194 194 { 195 195 metrics_mode pixels … … 204 204 colour_bottom 0.3 0.5 0.3 205 205 } 206 element TextArea(Example/ Occlusion/HierarchyNodes)206 element TextArea(Example/Visibility/RenderedNodes) 207 207 { 208 208 metrics_mode pixels … … 213 213 font_name TrebuchetMSBold 214 214 char_height 16 215 caption HierarchyNodes216 colour_top 0.5 0.7 0.5 217 colour_bottom 0.3 0.5 0.3 218 } 219 element TextArea(Example/ Occlusion/HierarchyNodesInfo)215 caption Rendered Nodes 216 colour_top 0.5 0.7 0.5 217 colour_bottom 0.3 0.5 0.3 218 } 219 element TextArea(Example/Visibility/RenderedNodesInfo) 220 220 { 221 221 metrics_mode pixels 222 222 left 180 223 223 top 65 224 width 90225 height 30226 font_name TrebuchetMSBold227 char_height 16228 caption :229 colour_top 0.5 0.7 0.5230 colour_bottom 0.3 0.5 0.3231 }232 element TextArea(Example/Occlusion/RenderedNodes)233 {234 metrics_mode pixels235 left 5236 top 80237 width 180238 height 30239 font_name TrebuchetMSBold240 char_height 16241 caption Rendered Nodes242 colour_top 0.5 0.7 0.5243 colour_bottom 0.3 0.5 0.3244 }245 element TextArea(Example/Occlusion/RenderedNodesInfo)246 {247 metrics_mode pixels248 left 180249 top 80250 224 width 90 251 225 height 30 -
trunk/VUT/Ogre/scripts/Plugin_VisibilitySceneManager.vcproj
r64 r74 40 40 LinkIncremental="2" 41 41 SuppressStartupBanner="TRUE" 42 AdditionalLibraryDirectories=""$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\ debug";..\lib\debug;..\..\lib\debug;..\..\GtpVisibility\lib\debug"42 AdditionalLibraryDirectories=""$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)";"..\lib\$(ConfigurationName)";"..\..\lib\$(ConfigurationName)";"..\..\GtpVisibility\lib\$(ConfigurationName)"" 43 43 ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def" 44 44 GenerateDebugInformation="TRUE" … … 87 87 EnableFiberSafeOptimizations="TRUE" 88 88 OptimizeForProcessor="2" 89 AdditionalIncludeDirectories=" ..\include;$(OGRE_PATH)\OgreMain\include"90 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_OCCLUSIONCULLINGSCENEMANAGER_EXPORTS "89 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\GtpVisibility\include" 90 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_OCCLUSIONCULLINGSCENEMANAGER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE" 91 91 StringPooling="TRUE" 92 92 RuntimeLibrary="2" … … 102 102 Name="VCLinkerTool" 103 103 IgnoreImportLibrary="TRUE" 104 AdditionalDependencies="OgreMain.lib "104 AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib" 105 105 OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll" 106 106 Version="0.99" 107 107 LinkIncremental="1" 108 108 SuppressStartupBanner="TRUE" 109 AdditionalLibraryDirectories=""$(OGRE_PATH)\ OgreMain\lib\$(ConfigurationName)";"..\..\..\Dependencies\lib\$(ConfigurationName)""109 AdditionalLibraryDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"..\..\GtpVisibility\lib\$(ConfigurationName)";"..\..\lib\$(ConfigurationName)";"..\lib\$(ConfigurationName)";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)"" 110 110 ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def" 111 111 GenerateDebugInformation="TRUE" … … 144 144 Name="SceneManager_Plugins" 145 145 Filter=""> 146 <File 147 RelativePath="..\..\GtpVisibility\include\VisibilityManager.h"> 148 </File> 146 149 <Filter 147 150 Name="Header Files" … … 154 157 </File> 155 158 <File 156 RelativePath="..\include\OgreVisibilityDotSceneManager.h">157 </File>158 <File159 159 RelativePath="..\include\OgreVisibilityOctreeSceneManager.h"> 160 160 </File> … … 171 171 <File 172 172 RelativePath="..\src\OgreOctreeHierarchyInterface.cpp"> 173 </File>174 <File175 RelativePath="..\src\OgreVisibilityDotSceneManager.cpp">176 173 </File> 177 174 <File … … 202 199 </File> 203 200 <File 201 RelativePath="..\include\OgreVisibilityOptionsManager.h"> 202 </File> 203 <File 204 204 RelativePath="..\include\OgreVisibilitySceneManager.h"> 205 205 </File> … … 221 221 </File> 222 222 <File 223 RelativePath="..\src\OgreVisibilityOptionsManager.cpp"> 224 </File> 225 <File 223 226 RelativePath="..\src\OgreVisibilitySceneManager.cpp"> 227 </File> 228 <File 229 RelativePath="..\src\OgreVisibilitySceneManagerDll.cpp"> 224 230 </File> 225 231 </Filter> -
trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp
r59 r74 16 16 } 17 17 //----------------------------------------------------------------------- 18 bool BspHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) 18 bool BspHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const 19 19 { 20 20 return true; 21 21 } 22 22 //----------------------------------------------------------------------- 23 bool BspHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) 23 bool BspHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const 24 24 { 25 25 return true; … … 27 27 //----------------------------------------------------------------------- 28 28 bool BspHierarchyInterface::HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 29 GtpVisibility::HierarchyNode *node2) 29 GtpVisibility::HierarchyNode *node2) const 30 30 { 31 31 return true; … … 37 37 } 38 38 //----------------------------------------------------------------------- 39 void BspHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) 39 void BspHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, 40 const bool visible) 40 41 { 41 42 } 42 43 //----------------------------------------------------------------------- 43 void BspHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) 44 void BspHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, 45 const unsigned int frameId) 44 46 { 45 47 } … … 53 55 } 54 56 //----------------------------------------------------------------------- 55 bool BspHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) 57 bool BspHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const 56 58 { 57 59 return true; 58 60 } 59 61 //----------------------------------------------------------------------- 60 int BspHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) 62 unsigned int BspHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 61 63 { 62 64 return 0; -
trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
r59 r74 2 2 #include "OgreVisibilityOctreeSceneManager.h" 3 3 #include <OgreOctree.h> 4 //#include <windows.h>4 #include <windows.h> 5 5 6 6 namespace Ogre { … … 19 19 RenderNode(node); 20 20 21 for(int i=0; i<8; i++)21 for(int i=0; i<8; ++i) 22 22 { 23 23 Octree *nextChild = 24 24 static_cast<Octree *>(node)->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1]; 25 25 26 if(nextChild)26 if (nextChild) 27 27 { 28 28 mDistanceQueue->push(nextChild); … … 31 31 } 32 32 //----------------------------------------------------------------------- 33 bool OctreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) 33 bool OctreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const 34 34 { 35 35 Octree *octant = static_cast<Octree *>(node); … … 37 37 for(int i=0; i<8; i++) 38 38 { 39 if (octant->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1])39 if (octant->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1]) 40 40 return false; 41 41 } … … 44 44 } 45 45 //----------------------------------------------------------------------- 46 bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) 46 bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const 47 47 { 48 48 return static_cast<Octree *>(node)->numNodes() > 0; … … 55 55 //----------------------------------------------------------------------- 56 56 bool OctreeHierarchyInterface::HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 57 GtpVisibility::HierarchyNode *node2) 57 GtpVisibility::HierarchyNode *node2) const 58 58 { 59 59 // matt: change this (inefficient) … … 66 66 } 67 67 //----------------------------------------------------------------------- 68 Real OctreeHierarchyInterface::GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const 68 Real OctreeHierarchyInterface::GetSquaredViewDepth(const Camera* cam, 69 const AxisAlignedBox* box) const 69 70 { 70 Vector3 mid 71 Vector3 mid = ((box->getMinimum() - box->getMaximum()) * 0.5) + box->getMinimum(); 71 72 return (cam->getDerivedPosition() - mid).squaredLength(); 72 73 } 73 74 //----------------------------------------------------------------------- 74 void OctreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) 75 void OctreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, 76 const bool visible) 75 77 { 76 78 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 79 81 } 80 82 //----------------------------------------------------------------------- 81 void OctreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) 83 void OctreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, 84 const unsigned int frameId) 82 85 { 83 86 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 117 120 } 118 121 //----------------------------------------------------------------------- 119 bool OctreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) 122 bool OctreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const 120 123 { 121 124 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 126 129 } 127 130 //----------------------------------------------------------------------- 128 int OctreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) 131 unsigned int OctreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 129 132 { 130 133 #ifdef GTP_VISIBILITY_MODIFIED_OGRE -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r59 r74 10 10 11 11 //----------------------------------------------------------------------- 12 PlatformHierarchyInterface::PlatformHierarchyInterface(SceneManager *sm, RenderSystem *rsys) 12 PlatformHierarchyInterface::PlatformHierarchyInterface(SceneManager *sm, RenderSystem *rsys): 13 mSceneManager(sm), mRenderSystem(rsys) 13 14 { 14 15 mHalfBoundingBox[0] = mHalfBoundingBox[1] = NULL; … … 45 46 46 47 mRenderSystem->_setWorldMatrix(Ogre::Matrix4::IDENTITY); 47 48 48 49 static RenderOperation ro; 49 50 50 mSceneManager->useRenderableViewProjMode(halfbox); 51 mSceneManager->useRenderableViewProjMode(halfbox); 52 mSceneManager->setPass(halfbox->getTechnique()->getPass(0)); 51 53 halfbox->getRenderOperation(ro); 52 54 ro.srcRenderable = halfbox; … … 66 68 return mHalfBoundingBox[half]; 67 69 } 68 //-----------------------------------------------------------------------69 /*void OcclusionHierarchyInterface::setNumHierarchyNodes(int num)70 {71 mNumSceneNodes = num;72 }*/73 70 //----------------------------------------------------------------------- 74 71 void PlatformHierarchyInterface::SetCamera(Ogre::Camera *cam) -
trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp
r59 r74 49 49 } 50 50 //----------------------------------------------------------------------- 51 bool SceneNodeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) 51 bool SceneNodeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const 52 52 { 53 53 return (static_cast<SceneNode *>(node)->numChildren() == 0); 54 54 } 55 55 //----------------------------------------------------------------------- 56 bool SceneNodeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) 56 bool SceneNodeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const 57 57 { 58 58 SceneNode *sceneNode = static_cast<SceneNode *>(node); … … 75 75 //----------------------------------------------------------------------- 76 76 bool SceneNodeHierarchyInterface::HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 77 GtpVisibility::HierarchyNode *node2) 77 GtpVisibility::HierarchyNode *node2) const 78 78 { 79 79 SceneNode *sceneNode1 = static_cast<SceneNode *>(node1); … … 92 92 } 93 93 //----------------------------------------------------------------------- 94 void SceneNodeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) 94 void SceneNodeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, 95 const unsigned int frameId) 95 96 { 96 97 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 100 101 } 101 102 //----------------------------------------------------------------------- 102 bool SceneNodeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) 103 bool SceneNodeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const 103 104 { 104 105 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 110 111 } 111 112 //----------------------------------------------------------------------- 112 int SceneNodeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) 113 unsigned int SceneNodeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 113 114 { 114 115 #ifdef GTP_VISIBILITY_MODIFIED_OGRE -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r59 r74 1 1 #include "OgreVisibilityOctreeSceneManager.h" 2 #include "OgreVisibilityOptionsManager.h" 2 3 #include <OgreMath.h> 3 4 #include <OgreIteratorWrappers.h> … … 17 18 18 19 //mDisplayNodes = true; 19 //mShowBoundingBoxes = true;20 //mShowBoxes = true;20 mShowBoundingBoxes = true; 21 mShowBoxes = true; 21 22 //mMaxDepth = 20; 22 23 } … … 45 46 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 46 47 47 mHierarchyInterface->InitFrame(m SceneRoot, mCameraInProgress);48 mHierarchyInterface->InitFrame(mOctree, mCameraInProgress); 48 49 mVisibilityManager->ApplyVisibilityCulling(); 49 50 … … 66 67 void VisibilityOctreeSceneManager::_updateSceneGraph(Camera* cam) 67 68 { 68 //mOcclusionOctreeHierarchyInterface->setNumSceneNodes((int)mSceneNodes.size());69 69 mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface); 70 70 mHierarchyInterface->SetRenderSystem(mDestRenderSystem); … … 78 78 bool VisibilityOctreeSceneManager::setOption(const String & key, const void * val) 79 79 { 80 return /*mVisibilitySceneTraverser->setOption( key, val) || */OctreeSceneManager::setOption( key, val ); 80 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 81 setOption(key, val) || OctreeSceneManager::setOption(key, val); 81 82 } 82 83 //----------------------------------------------------------------------- 83 84 bool VisibilityOctreeSceneManager::getOption(const String & key, void *val) 84 85 { 85 return /*mVisibilitySceneTraverser->getOption( key, val) || */OctreeSceneManager::getOption(key, val); 86 if (key == "NumHierarchyNodes") 87 { 88 * static_cast<unsigned int *>(val) = (unsigned int)mNumOctreeNodes; 89 return true; 90 } 91 92 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 93 getOption(key, val) && OctreeSceneManager::getOption(key, val); 86 94 } 87 95 //----------------------------------------------------------------------- … … 93 101 bool VisibilityOctreeSceneManager::getOptionKeys(StringVector & refKeys) 94 102 { 95 return /*mVisibilitySceneTraverser->getOptionKeys ( refKeys ) || */OctreeSceneManager::getOptionKeys(refKeys); 103 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 104 getOptionKeys ( refKeys ) || OctreeSceneManager::getOptionKeys(refKeys); 96 105 } 97 106 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp
r59 r74 5 5 #include "OgreVisibilitySceneManager.h" 6 6 #include "OgreSceneNodeHierarchyInterface.h" 7 #include "OgreVisibilityOptionsManager.h" 7 8 8 9 //#include <windows.h> … … 45 46 46 47 mHierarchyInterface->InitFrame(mSceneRoot, mCameraInProgress); 47 48 48 mVisibilityManager->ApplyVisibilityCulling(); 49 49 … … 61 61 void VisibilitySceneManager::_updateSceneGraph(Camera* cam) 62 62 { 63 //mVisibilitySceneTraverser->setNumSceneNodes((int)mSceneNodes.size());64 63 mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface); 65 64 mHierarchyInterface->SetRenderSystem(mDestRenderSystem); 66 65 67 //mVisibilitySceneTraverser->setNumQueries((int)mSceneNodes.size());68 69 66 SceneManager::_updateSceneGraph(cam); 70 67 } … … 72 69 bool VisibilitySceneManager::setOption(const String & key, const void * val) 73 70 { 74 //mVisibilitySceneTraverser->setOption(key, val);75 returnSceneManager::setOption(key, val);71 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 72 setOption(key, val) || SceneManager::setOption(key, val); 76 73 } 77 74 //----------------------------------------------------------------------- 78 75 bool VisibilitySceneManager::getOption(const String & key, void *val) 79 76 { 80 //mVisibilitySceneTraverser->getOption(key, val); 77 if (key == "NumHierarchyNodes") 78 { 79 * static_cast<unsigned int *>(val) = (unsigned int)mSceneNodes.size(); 80 return true; 81 } 81 82 82 return SceneManager::getOption(key, val); 83 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 84 getOption(key, val) && SceneManager::getOption(key, val); 83 85 } 84 86 //----------------------------------------------------------------------- … … 90 92 bool VisibilitySceneManager::getOptionKeys(StringVector & refKeys) 91 93 { 92 SceneManager::getOptionKeys(refKeys); 93 //mVisibilitySceneTraverser->getOptionKeys( refKeys ); 94 95 return true; 94 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 95 getOptionKeys(refKeys) || SceneManager::getOptionKeys(refKeys); 96 96 } 97 97 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreVisibilitySceneManagerDll.cpp
r59 r74 24 24 */ 25 25 26 #include <Ogre OcclusionCullingTerrainSceneManager.h>27 #include <Ogre OcclusionCullingOctreeSceneManager.h>28 //#include <Ogre OcclusionCullingDotSceneManager.h>26 #include <OgreVisibilityTerrainSceneManager.h> 27 #include <OgreVisibilityOctreeSceneManager.h> 28 //#include <OgreVisibilityDotSceneManager.h> 29 29 #include <OgreHeightmapTerrainPageSource.h> 30 #include " GtpVisibilityManager.h"31 #include " GtpVisibilityStopAndWaitManager.h"32 #include " GtpVisibilityEnvironment.h"30 #include "VisibilityManager.h" 31 #include "StopAndWaitCullingManager.h" 32 #include "VisibilityEnvironment.h" 33 33 34 34 #include <OgreRoot.h> 35 35 36 36 //#include <windows.h> 37 GtpVisibility:: Environment *visEnv;38 GtpVisibility:: Manager *visManager;37 GtpVisibility::VisibilityEnvironment *visEnv; 38 GtpVisibility::VisibilityManager *visManager; 39 39 40 40 namespace Ogre { 41 41 42 // OcclusionCullingDotSceneManager *occlusionDotPlugin;43 OcclusionCullingOctreeSceneManager *cullingOctreePlugin;44 OcclusionCullingTerrainSceneManager *cullingTerrainPlugin;42 // VisibilityDotSceneManager *occlusionDotPlugin; 43 VisibilityOctreeSceneManager *cullingOctreePlugin; 44 VisibilityTerrainSceneManager *cullingTerrainPlugin; 45 45 46 46 HeightmapTerrainPageSource *heightmapTerrainPageSource; … … 49 49 extern "C" void dllStartPlugin(void) 50 50 { 51 visManager = new GtpVisibility:: Manager(visEnv);51 visManager = new GtpVisibility::VisibilityManager(visEnv); 52 52 // Create new scene manager 53 //occlusionDotPlugin = new OcclusionCullingDotSceneManager();54 cullingOctreePlugin = new OcclusionCullingOctreeSceneManager(visManager);55 cullingTerrainPlugin = new OcclusionCullingTerrainSceneManager(visManager);53 //occlusionDotPlugin = new VisibilityDotSceneManager(); 54 cullingOctreePlugin = new VisibilityOctreeSceneManager(visManager); 55 cullingTerrainPlugin = new VisibilityTerrainSceneManager(visManager); 56 56 heightmapTerrainPageSource = new HeightmapTerrainPageSource(); 57 57 -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r59 r74 1 1 #include "OgreVisibilityTerrainSceneManager.h" 2 2 #include "OgreOctreeHierarchyInterface.h" 3 #include "OgreVisibilityOptionsManager.h" 3 4 #include <OgreMath.h> 4 5 #include <OgreIteratorWrappers.h> … … 18 19 19 20 setVisibilityManager(visManager); 20 //mShowBoxes = true;21 mShowBoxes = true; 21 22 //mDisplayNodes = true; 22 //mShowBoundingBoxes = true;23 mShowBoundingBoxes = true; 23 24 mMaxDepth = 20; 24 25 } … … 47 48 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 48 49 49 mHierarchyInterface->InitFrame(mSceneRoot, mCameraInProgress); 50 mHierarchyInterface->InitFrame(mOctree, mCameraInProgress); 51 mVisibilityManager->ApplyVisibilityCulling(); 50 52 51 mVisibilityManager->ApplyVisibilityCulling();52 53 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 53 54 _deleteRenderedQueueGroups(); … … 70 71 mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface); 71 72 mHierarchyInterface->SetRenderSystem(mDestRenderSystem); 73 72 74 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 73 75 mHierarchyInterface->SetNumOctreeNodes(mNumOctreeNodes); … … 78 80 bool VisibilityTerrainSceneManager::setOption(const String & key, const void * val) 79 81 { 80 return /*mOcclusionOctreeHierarchyInterface->setOption( key, val) || */TerrainSceneManager::setOption( key, val ); 82 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 83 setOption(key, val) || TerrainSceneManager::setOption(key, val); 81 84 } 82 85 //----------------------------------------------------------------------- 83 86 bool VisibilityTerrainSceneManager::getOption(const String & key, void *val) 84 87 { 85 return /*mOcclusionOctreeHierarchyInterface->getOption( key, val) || */TerrainSceneManager::getOption( key, val ) ; 88 if (key == "NumHierarchyNodes") 89 { 90 * static_cast<unsigned int *>(val) = (unsigned int)mNumOctreeNodes; 91 return true; 92 } 93 94 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 95 getOption(key, val) && TerrainSceneManager::getOption(key, val); 86 96 } 87 97 //----------------------------------------------------------------------- 88 98 bool VisibilityTerrainSceneManager::getOptionValues(const String & key, StringVector &refValueList) 89 99 { 90 return TerrainSceneManager::getOptionValues( key, refValueList 100 return TerrainSceneManager::getOptionValues( key, refValueList); 91 101 } 92 102 //----------------------------------------------------------------------- 93 103 bool VisibilityTerrainSceneManager::getOptionKeys(StringVector & refKeys) 94 104 { 95 return /*mOcclusionOctreeHierarchyInterface->getOptionKeys ( refKeys ) ||*/ TerrainSceneManager::getOptionKeys( refKeys ); 105 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 106 getOptionKeys(refKeys) || TerrainSceneManager::getOptionKeys(refKeys); 96 107 } 97 108 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.