Converted the instances of const built in types being returned from methods
and passed as paramters into straight forward non const built in types, i.e. const bool foogbar(const int) becomes bool foobar(int).
This commit is contained in:
@@ -50,8 +50,8 @@ class SG_EXPORT Matrix : public Object
|
||||
inline float& operator()(int row, int col) { return _mat[row][col]; }
|
||||
inline float operator()(int row, int col) const { return _mat[row][col]; }
|
||||
|
||||
inline const bool valid() const { return !isNaN(); }
|
||||
inline const bool isNaN() const { return osg::isNaN(_mat[0][0]) || osg::isNaN(_mat[0][1]) || osg::isNaN(_mat[0][2]) || osg::isNaN(_mat[0][3]) ||
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
inline bool isNaN() const { return osg::isNaN(_mat[0][0]) || osg::isNaN(_mat[0][1]) || osg::isNaN(_mat[0][2]) || osg::isNaN(_mat[0][3]) ||
|
||||
osg::isNaN(_mat[1][0]) || osg::isNaN(_mat[1][1]) || osg::isNaN(_mat[1][2]) || osg::isNaN(_mat[1][3]) ||
|
||||
osg::isNaN(_mat[2][0]) || osg::isNaN(_mat[2][1]) || osg::isNaN(_mat[2][2]) || osg::isNaN(_mat[2][3]) ||
|
||||
osg::isNaN(_mat[3][0]) || osg::isNaN(_mat[3][1]) || osg::isNaN(_mat[3][2]) || osg::isNaN(_mat[3][3]); }
|
||||
@@ -61,13 +61,13 @@ class SG_EXPORT Matrix : public Object
|
||||
inline Matrix& operator = (const Matrix& other)
|
||||
{
|
||||
if( &other == this ) return *this;
|
||||
std::copy((const float*)other._mat,(const float*)other._mat+16,(float*)(_mat));
|
||||
std::copy((float*)other._mat,(float*)other._mat+16,(float*)(_mat));
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline void set(const Matrix& other)
|
||||
{
|
||||
std::copy((const float*)other._mat,(const float*)other._mat+16,(float*)(_mat));
|
||||
std::copy((float*)other._mat,(float*)other._mat+16,(float*)(_mat));
|
||||
}
|
||||
|
||||
inline void set(float const * const ptr)
|
||||
@@ -81,7 +81,7 @@ class SG_EXPORT Matrix : public Object
|
||||
float a30, float a31, float a32, float a33);
|
||||
|
||||
float * ptr() { return (float *)_mat; }
|
||||
const float * ptr() const { return (const float *)_mat; }
|
||||
float * ptr() const { return (float *)_mat; }
|
||||
|
||||
void makeIdentity();
|
||||
|
||||
@@ -102,26 +102,26 @@ class SG_EXPORT Matrix : public Object
|
||||
|
||||
|
||||
/** Set to a orthographic projection. See glOrtho for further details.*/
|
||||
void makeOrtho(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
void makeOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to a 2D orthographic projection. See glOrtho2D for further details.*/
|
||||
inline void makeOrtho2D(const double left, const double right,
|
||||
const double bottom, const double top)
|
||||
inline void makeOrtho2D(double left, double right,
|
||||
double bottom, double top)
|
||||
{
|
||||
makeOrtho(left,right,bottom,top,-1.0,1.0);
|
||||
}
|
||||
|
||||
/** Set to a perspective projection. See glFrustum for further details.*/
|
||||
void makeFrustum(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
void makeFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to a symmetrical perspective projection, See gluPerspective for further details.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
void makePerspective(const double fovy,const double aspectRatio,
|
||||
const double zNear, const double zFar);
|
||||
void makePerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to the position and orientation as per a camera, using the same convention as gluLookAt. */
|
||||
void makeLookAt(const Vec3& eye,const Vec3& center,const Vec3& up);
|
||||
@@ -145,23 +145,23 @@ class SG_EXPORT Matrix : public Object
|
||||
inline static Matrix inverse( const Matrix& matrix);
|
||||
|
||||
/** Create a orthographic projection. See glOrtho for further details.*/
|
||||
inline static Matrix ortho(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
inline static Matrix ortho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create a 2D orthographic projection. See glOrtho for further details.*/
|
||||
inline static Matrix ortho2D(const double left, const double right,
|
||||
const double bottom, const double top);
|
||||
inline static Matrix ortho2D(double left, double right,
|
||||
double bottom, double top);
|
||||
|
||||
/** Create a perspective projection. See glFrustum for further details.*/
|
||||
inline static Matrix frustum(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
inline static Matrix frustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create a symmetrical perspective projection, See gluPerspective for further details.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
inline static Matrix perspective(const double fovy,const double aspectRatio,
|
||||
const double zNear, const double zFar);
|
||||
inline static Matrix perspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create the position and orientation as per a camera, using the same convention as gluLookAt. */
|
||||
inline static Matrix lookAt(const Vec3& eye,const Vec3& center,const Vec3& up);
|
||||
@@ -310,34 +310,34 @@ inline Matrix Matrix::inverse( const Matrix& matrix)
|
||||
return m;
|
||||
}
|
||||
|
||||
inline Matrix Matrix::ortho(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar)
|
||||
inline Matrix Matrix::ortho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
Matrix m;
|
||||
m.makeOrtho(left,right,bottom,top,zNear,zFar);
|
||||
return m;
|
||||
}
|
||||
|
||||
inline Matrix Matrix::ortho2D(const double left, const double right,
|
||||
const double bottom, const double top)
|
||||
inline Matrix Matrix::ortho2D(double left, double right,
|
||||
double bottom, double top)
|
||||
{
|
||||
Matrix m;
|
||||
m.makeOrtho2D(left,right,bottom,top);
|
||||
return m;
|
||||
}
|
||||
|
||||
inline Matrix Matrix::frustum(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar)
|
||||
inline Matrix Matrix::frustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
Matrix m;
|
||||
m.makeFrustum(left,right,bottom,top,zNear,zFar);
|
||||
return m;
|
||||
}
|
||||
|
||||
inline Matrix Matrix::perspective(const double fovy,const double aspectRatio,
|
||||
const double zNear, const double zFar)
|
||||
inline Matrix Matrix::perspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
Matrix m;
|
||||
m.makePerspective(fovy,aspectRatio,zNear,zFar);
|
||||
|
||||
Reference in New Issue
Block a user