Made the handling of types more consistent
This commit is contained in:
@@ -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.*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user