Made the handling of types more consistent

This commit is contained in:
Robert Osfield
2004-07-26 19:40:02 +00:00
parent f6274d0f20
commit 8837d667f0
3 changed files with 4 additions and 10 deletions

View File

@@ -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.*/

View File

@@ -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;

View File

@@ -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
{