diff --git a/ChangeLog b/ChangeLog index 12068cf76..84708419b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ OSG Change log ============== + + o Made spelling corrections in include/osgDB,osgUtil,osgGLUT,osgWX, + spelling mistakes picked up by a script written by Neil Salter. + o Made osg::Matrix::_mat private, and updated the rest of the osg + to use the Matrix::operate(row,col) method instead of _mat[row][col]. o Placed #ifdef USE_DEPRECATED_MATRIX_METHODS about pre/postScale, pre/postTrans and pre/postRot methods since these are now deprecated, there functionality replace by scale,trans,rotate diff --git a/include/osg/Matrix b/include/osg/Matrix index d833216ac..fc077d44e 100644 --- a/include/osg/Matrix +++ b/include/osg/Matrix @@ -48,8 +48,8 @@ class SG_EXPORT Matrix : public Object bool operator == (const Matrix& m) const { return compare(m)==0; } bool operator != (const Matrix& m) const { return compare(m)!=0; } - inline float& operator()(int col, int row) { return _mat[row][col]; } - inline float operator()(int col, int row) const { return _mat[row][col]; } + inline float& operator()(int row, int col) { return _mat[row][col]; } + inline float operator()(int row, int col) const { return _mat[row][col]; } void set( float const * const ); void set( float a00, float a01, float a02, float a03, diff --git a/include/osg/StateSet b/include/osg/StateSet index 43209ec8b..a59b177a2 100644 --- a/include/osg/StateSet +++ b/include/osg/StateSet @@ -71,6 +71,10 @@ class SG_EXPORT StateSet : public Object /** get specified StateAttribute for specified type. * returns NULL if no type is contained within StateSet.*/ + StateAttribute* getAttribute(const StateAttribute::Type type); + + /** get specified const StateAttribute for specified type. + * returns NULL if no type is contained within const StateSet.*/ const StateAttribute* getAttribute(const StateAttribute::Type type) const; /** get specified RefAttributePair for specified type. diff --git a/src/osg/StateSet.cpp b/src/osg/StateSet.cpp index 0fe6077f2..14fa1c070 100644 --- a/src/osg/StateSet.cpp +++ b/src/osg/StateSet.cpp @@ -123,6 +123,17 @@ void StateSet::setAttributeToInherit(const StateAttribute::Type type) } } +StateAttribute* StateSet::getAttribute(const StateAttribute::Type type) +{ + AttributeList::iterator itr = _attributeList.find(type); + if (itr!=_attributeList.end()) + { + return itr->second.first.get(); + } + else + return NULL; +} + const StateAttribute* StateSet::getAttribute(const StateAttribute::Type type) const { AttributeList::const_iterator itr = _attributeList.find(type);