diff --git a/include/osg/CullSettings b/include/osg/CullSettings index bc422eb1b..4ead2e0cb 100644 --- a/include/osg/CullSettings +++ b/include/osg/CullSettings @@ -52,7 +52,7 @@ class OSG_EXPORT CullSettings } - void setDefaults(); + virtual void setDefaults(); enum VariablesMask diff --git a/include/osgUtil/SceneView b/include/osgUtil/SceneView index 2293831f9..a7c75ac88 100644 --- a/include/osgUtil/SceneView +++ b/include/osgUtil/SceneView @@ -52,10 +52,13 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings COMPILE_GLOBJECTS_AT_INIT }; + /* Set defaults. */ + virtual void setDefaults() { setDefaults(STANDARD_SETTINGS); } + /** Set scene view to use default global state, light, camera * and render visitor. */ - void setDefaults(unsigned int options = STANDARD_SETTINGS); + virtual void setDefaults(unsigned int options); /** Set the camera used to represent the camera view of this SceneView.*/ void setCamera(osg::Camera* camera); @@ -423,7 +426,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings virtual osg::Matrixd computeRightEyeViewImplementation(const osg::Matrixd& view) const; /** Inherit the local cull settings variable from specified CullSettings object, according to the inheritance mask.*/ - void inheritCullSettings(const CullSettings& settings) { inheritCullSettings(settings, _inheritanceMask); } + virtual void inheritCullSettings(const CullSettings& settings) { inheritCullSettings(settings, _inheritanceMask); } /** Inherit the local cull settings variable from specified CullSettings object, according to the inheritance mask.*/ virtual void inheritCullSettings(const osg::CullSettings& settings, unsigned int inheritanceMask); diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index 1ffffa491..3ee740339 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -159,6 +159,8 @@ SceneView::~SceneView() void SceneView::setDefaults(unsigned int options) { + osg::CullSettings::setDefaults(); + _camera->getProjectionMatrix().makePerspective(50.0f,1.4f,1.0f,10000.0f); _camera->getViewMatrix().makeIdentity();