diff --git a/include/osg/Camera b/include/osg/Camera index 23aa7591f..06e23268c 100644 --- a/include/osg/Camera +++ b/include/osg/Camera @@ -206,13 +206,13 @@ class OSG_EXPORT Camera : public Transform, public CullSettings * Returns false if matrix is not an orthographic matrix, where parameter values are undefined.*/ bool getProjectionMatrixAsOrtho(double& left, double& right, double& bottom, double& top, - double& zNear, double& zFar); + double& zNear, double& zFar) const; /** Get the frustum setting of a perspective projection matrix. * Returns false if matrix is not a perspective matrix, where parameter values are undefined.*/ bool getProjectionMatrixAsFrustum(double& left, double& right, double& bottom, double& top, - double& zNear, double& zFar); + double& zNear, double& zFar) const; /** Get the frustum setting of a symmetric perspective projection matrix. * Returns false if matrix is not a perspective matrix, where parameter values are undefined. @@ -220,7 +220,7 @@ class OSG_EXPORT Camera : public Transform, public CullSettings * Asymmetric matrices occur when stereo, power walls, caves and reality center display are used. * In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead.*/ bool getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio, - double& zNear, double& zFar); + double& zNear, double& zFar) const; @@ -240,10 +240,10 @@ class OSG_EXPORT Camera : public Transform, public CullSettings void setViewMatrixAsLookAt(const osg::Vec3d& eye,const osg::Vec3d& center,const osg::Vec3d& up); /** Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. */ - void getViewMatrixAsLookAt(osg::Vec3d& eye,osg::Vec3d& center,osg::Vec3d& up,double lookDistance=1.0); + void getViewMatrixAsLookAt(osg::Vec3d& eye,osg::Vec3d& center,osg::Vec3d& up,double lookDistance=1.0) const; /** Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. */ - void getViewMatrixAsLookAt(osg::Vec3f& eye,osg::Vec3f& center,osg::Vec3f& up,float lookDistance=1.0f); + void getViewMatrixAsLookAt(osg::Vec3f& eye,osg::Vec3f& center,osg::Vec3f& up,float lookDistance=1.0f) const; /** Get the inverse view matrix.*/ Matrixd getInverseViewMatrix() const; diff --git a/src/osg/Camera.cpp b/src/osg/Camera.cpp index c9507406f..89056864e 100644 --- a/src/osg/Camera.cpp +++ b/src/osg/Camera.cpp @@ -215,7 +215,7 @@ void Camera::setProjectionMatrixAsPerspective(double fovy,double aspectRatio, bool Camera::getProjectionMatrixAsOrtho(double& left, double& right, double& bottom, double& top, - double& zNear, double& zFar) + double& zNear, double& zFar) const { return _projectionMatrix.getOrtho(left, right, bottom, top, @@ -224,7 +224,7 @@ bool Camera::getProjectionMatrixAsOrtho(double& left, double& right, bool Camera::getProjectionMatrixAsFrustum(double& left, double& right, double& bottom, double& top, - double& zNear, double& zFar) + double& zNear, double& zFar) const { return _projectionMatrix.getFrustum(left, right, bottom, top, @@ -232,7 +232,7 @@ bool Camera::getProjectionMatrixAsFrustum(double& left, double& right, } bool Camera::getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio, - double& zNear, double& zFar) + double& zNear, double& zFar) const { return _projectionMatrix.getPerspective(fovy, aspectRatio, zNear, zFar); } @@ -242,12 +242,12 @@ void Camera::setViewMatrixAsLookAt(const Vec3d& eye,const Vec3d& center,const Ve setViewMatrix(osg::Matrixd::lookAt(eye,center,up)); } -void Camera::getViewMatrixAsLookAt(Vec3d& eye,Vec3d& center,Vec3d& up,double lookDistance) +void Camera::getViewMatrixAsLookAt(Vec3d& eye,Vec3d& center,Vec3d& up,double lookDistance) const { _viewMatrix.getLookAt(eye,center,up,lookDistance); } -void Camera::getViewMatrixAsLookAt(Vec3f& eye,Vec3f& center,Vec3f& up,float lookDistance) +void Camera::getViewMatrixAsLookAt(Vec3f& eye,Vec3f& center,Vec3f& up,float lookDistance) const { _viewMatrix.getLookAt(eye,center,up,lookDistance); }