From Michael Platings, introduced osg::State::applyModelViewMaitrx(const osg::Matrix& matrix) method and associated osg::State::_modelViewCache to enable osgText::Text3D to be refactored in away that avoids creating/destroying matrices

This commit is contained in:
Robert Osfield
2010-06-01 13:33:58 +00:00
parent 0cb839280f
commit 4a047f2a82
3 changed files with 45 additions and 27 deletions

View File

@@ -191,6 +191,7 @@ class OSG_EXPORT State : public Referenced, public Observer
inline const osg::Matrix& getProjectionMatrix() const { return *_projection; }
void applyModelViewMatrix(const osg::RefMatrix* matrix);
void applyModelViewMatrix(const osg::Matrix&);
const osg::Matrix& getModelViewMatrix() const { return *_modelView; }
@@ -1344,6 +1345,7 @@ class OSG_EXPORT State : public Referenced, public Observer
ref_ptr<const RefMatrix> _initialViewMatrix;
ref_ptr<const RefMatrix> _projection;
ref_ptr<const RefMatrix> _modelView;
ref_ptr<RefMatrix> _modelViewCache;
bool _useModelViewAndProjectionUniforms;
ref_ptr<Uniform> _modelViewMatrixUniform;
@@ -1647,6 +1649,8 @@ class OSG_EXPORT State : public Referenced, public Observer
bool getLastAppliedMode(const ModeMap& modeMap,StateAttribute::GLMode mode) const;
const StateAttribute* getLastAppliedAttribute(const AttributeMap& attributeMap,StateAttribute::Type type, unsigned int member) const;
void loadModelViewMatrix();
mutable bool _isSecondaryColorSupportResolved;
mutable bool _isSecondaryColorSupported;