Made getLookAt() etc methods const

This commit is contained in:
Robert Osfield
2004-01-23 16:09:56 +00:00
parent 0300607dbb
commit 635cf7f7c5
3 changed files with 12 additions and 12 deletions

View File

@@ -128,7 +128,7 @@ class SG_EXPORT Matrixd
* Note, if matrix is not an orthographic matrix then invalid values will be returned.*/
bool getOrtho(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar);
double& zNear, double& zFar) const;
/** Set to a 2D orthographic projection. See glOrtho2D for further details.*/
inline void makeOrtho2D(double left, double right,
@@ -147,7 +147,7 @@ class SG_EXPORT Matrixd
* Note, if matrix is not an perspective matrix then invalid values will be returned.*/
bool getFrustum(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar);
double& zNear, double& zFar) const;
/** Set to a symmetrical perspective projection, See gluPerspective for further details.
* Aspect ratio is defined as width/height.*/
@@ -160,13 +160,13 @@ class SG_EXPORT Matrixd
* Asymetric metrices occur when stereo, power walls, caves and reality center display are used.
* In these configuration one should use the AsFrustum method instead.*/
bool getPerspective(double& fovy,double& aspectRatio,
double& zNear, double& zFar);
double& zNear, double& zFar) const;
/** Set to the position and orientation modelview matrix, using the same convention as gluLookAt. */
void makeLookAt(const Vec3& eye,const Vec3& center,const Vec3& up);
/** Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. */
void getLookAt(Vec3& eye,Vec3& center,Vec3& up,value_type lookDistance=1.0f);
void getLookAt(Vec3& eye,Vec3& center,Vec3& up,value_type lookDistance=1.0f) const;
/** invert the matrix rhs. */
bool invert( const Matrixd& rhs);

View File

@@ -126,7 +126,7 @@ class SG_EXPORT Matrixf
* Note, if matrix is not an orthographic matrix then invalid values will be returned.*/
bool getOrtho(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar);
double& zNear, double& zFar) const;
/** Set to a 2D orthographic projection. See glOrtho2D for further details.*/
inline void makeOrtho2D(double left, double right,
@@ -145,7 +145,7 @@ class SG_EXPORT Matrixf
* Returns false if matrix is not an orthographic matrix, where parameter values are undefined.*/
bool getFrustum(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar);
double& zNear, double& zFar) const;
/** Set to a symmetrical perspective projection, See gluPerspective for further details.
* Aspect ratio is defined as width/height.*/
@@ -158,14 +158,14 @@ class SG_EXPORT Matrixf
* Asymetric metrices occur when stereo, power walls, caves and reality center display are used.
* In these configuration one should use the AsFrustum method instead.*/
bool getPerspective(double& fovy,double& aspectRatio,
double& zNear, double& zFar);
double& zNear, double& zFar) const;
/** Set to the position and orientation modelview matrix, using the same convention as gluLookAt. */
void makeLookAt(const Vec3& eye,const Vec3& center,const Vec3& up);
/** Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. */
void getLookAt(Vec3& eye,Vec3& center,Vec3& up,value_type lookDistance=1.0f);
void getLookAt(Vec3& eye,Vec3& center,Vec3& up,value_type lookDistance=1.0f) const;
/** invert the matrix rhs placing result in this matrix.*/
bool invert( const Matrixf& rhs);

View File

@@ -608,7 +608,7 @@ void Matrix_implementation::makeOrtho(double left, double right,
bool Matrix_implementation::getOrtho(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar)
double& zNear, double& zFar) const
{
if (_mat[0][3]!=0.0 || _mat[1][3]!=0.0 || _mat[2][3]!=0.0 || _mat[3][3]!=1.0) return false;
@@ -642,7 +642,7 @@ void Matrix_implementation::makeFrustum(double left, double right,
bool Matrix_implementation::getFrustum(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar)
double& zNear, double& zFar) const
{
if (_mat[0][3]!=0.0 || _mat[1][3]!=0.0 || _mat[2][3]!=-1.0 || _mat[3][3]!=0.0) return false;
@@ -673,7 +673,7 @@ void Matrix_implementation::makePerspective(double fovy,double aspectRatio,
}
bool Matrix_implementation::getPerspective(double& fovy,double& aspectRatio,
double& zNear, double& zFar)
double& zNear, double& zFar) const
{
double right = 0.0;
double left = 0.0;
@@ -706,7 +706,7 @@ void Matrix_implementation::makeLookAt(const Vec3& eye,const Vec3& center,const
preMult(Matrix_implementation::translate(-eye));
}
void Matrix_implementation::getLookAt(Vec3& eye,Vec3& center,Vec3& up,value_type lookDistance)
void Matrix_implementation::getLookAt(Vec3& eye,Vec3& center,Vec3& up,value_type lookDistance) const
{
Matrix_implementation inv;
inv.invert(*this);