diff --git a/include/osg/CullSettings b/include/osg/CullSettings index 8da99af6e..bf06fbfc7 100644 --- a/include/osg/CullSettings +++ b/include/osg/CullSettings @@ -165,8 +165,8 @@ class SG_EXPORT CullSettings * can target either Matrix data type, configured at compile time.*/ struct ClampProjectionMatrixCallback : public osg::Referenced { - virtual bool clampProjectionMatrixImplementation(osg::Matrixf& projection, double znear, double zfar) const = 0; - virtual bool clampProjectionMatrixImplementation(osg::Matrixd& projection, double znear, double zfar) const = 0; + virtual bool clampProjectionMatrixImplementation(osg::Matrixf& projection, double& znear, double& zfar) const = 0; + virtual bool clampProjectionMatrixImplementation(osg::Matrixd& projection, double& znear, double& zfar) const = 0; }; /** set the ClampProjectionMatrixCallback.*/ diff --git a/include/osgUtil/CullVisitor b/include/osgUtil/CullVisitor index e4eec873a..c36d73847 100644 --- a/include/osgUtil/CullVisitor +++ b/include/osgUtil/CullVisitor @@ -205,7 +205,7 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac } /** clamp the projection double matrix to computed near and far values, use callback if it exists, otherwise use default CullVisitro implemntation.*/ - inline bool clampProjectionMatrix(osg::Matrixd& projection, value_type znear, value_type zfar) const + inline bool clampProjectionMatrix(osg::Matrixd& projection, value_type& znear, value_type& zfar) const { double zn = znear; double zf = zfar; diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 0e8801b91..dfd8d6a46 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -211,13 +211,7 @@ void CullVisitor::popProjectionMatrix() // so it doesn't cull them out. osg::Matrix& projection = *_projectionStack.back(); - double znear = _computed_znear; - double zfar = _computed_zfar; - - clampProjectionMatrix(projection, znear, zfar); - - _computed_znear = znear; - _computed_zfar = zfar; + clampProjectionMatrix(projection, _computed_znear, _computed_zfar); } else {