From 168ab6760b11c515c3d1b3437e87d633396a7de3 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 27 Jan 2008 21:01:06 +0000 Subject: [PATCH] Started moving code for maintaining scene graph out of _findVisibleObjects and into main application. --- include/MaterialMap.h | 4 +++- include/PolyVoxSceneManager.h | 6 +++--- include/SurfacePatchRenderable.h | 2 +- source/PolyVoxSceneManager.cpp | 4 ++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/MaterialMap.h b/include/MaterialMap.h index b00fb334..321033a8 100644 --- a/include/MaterialMap.h +++ b/include/MaterialMap.h @@ -3,9 +3,11 @@ #include +#include "TypeDef.h" + namespace Ogre { - class MaterialMap : public Ogre::Resource + class VOXEL_SCENE_MANAGER_API MaterialMap : public Ogre::Resource { String mMaterials[256]; diff --git a/include/PolyVoxSceneManager.h b/include/PolyVoxSceneManager.h index 1ff04d2d..99ee02d3 100644 --- a/include/PolyVoxSceneManager.h +++ b/include/PolyVoxSceneManager.h @@ -72,7 +72,7 @@ namespace Ogre //Setters void setNormalGenerationMethod(NormalGenerationMethod method); - void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo * visibleBounds, bool onlyShadowCasters); + //void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo * visibleBounds, bool onlyShadowCasters); std::list getChangedRegionGeometry(void); @@ -93,7 +93,7 @@ namespace Ogre void setAxisVisible(bool visible); - SceneNode* makeSureSceneNodeExists(bool bShouldExist, const String strSceneNodeName); + //SceneNode* makeSureSceneNodeExists(bool bShouldExist, const String strSceneNodeName); @@ -106,7 +106,7 @@ namespace Ogre Vector3 computeNormal(const Vector3& position, NormalGenerationMethod normalGenerationMethod) const; - private: + public: void markVoxelChanged(uint x, uint y, uint z); void markRegionChanged(uint firstX, uint firstY, uint firstZ, uint lastX, uint lastY, uint lastZ); diff --git a/include/SurfacePatchRenderable.h b/include/SurfacePatchRenderable.h index 0f8e5ea9..15ebcd4e 100644 --- a/include/SurfacePatchRenderable.h +++ b/include/SurfacePatchRenderable.h @@ -15,7 +15,7 @@ namespace Ogre //IDEA - If profiling identifies this class as a bottleneck, we could implement a memory pooling system. //All buffers could be powers of two, and we get the smallest one which is big enough for our needs. //See http://www.ogre3d.org/wiki/index.php/DynamicGrowingBuffers - class SurfacePatchRenderable : public SimpleRenderable + class VOXEL_SCENE_MANAGER_API SurfacePatchRenderable : public SimpleRenderable { public: SurfacePatchRenderable(const String& name); diff --git a/source/PolyVoxSceneManager.cpp b/source/PolyVoxSceneManager.cpp index 236c861e..f972389e 100644 --- a/source/PolyVoxSceneManager.cpp +++ b/source/PolyVoxSceneManager.cpp @@ -110,6 +110,8 @@ namespace Ogre return true; } + +#ifdef BLAH void PolyVoxSceneManager::_findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo * visibleBounds, bool onlyShadowCasters) { if(!volumeData.isNull()) @@ -240,6 +242,8 @@ namespace Ogre } } +#endif + std::list PolyVoxSceneManager::getChangedRegionGeometry(void) { std::list listChangedRegionGeometry;