From 99cb08ef8756abf0819e89f73c852675c1e4fabd Mon Sep 17 00:00:00 2001 From: frohlich Date: Sun, 7 Jan 2007 19:00:25 +0000 Subject: [PATCH] Modified Files: src/Model/panelnode.cxx src/Model/panelnode.hxx: Make it compile also with osg HEAD. --- src/Model/panelnode.cxx | 14 ++++++++------ src/Model/panelnode.hxx | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Model/panelnode.cxx b/src/Model/panelnode.cxx index c32d89830..8413da54c 100644 --- a/src/Model/panelnode.cxx +++ b/src/Model/panelnode.cxx @@ -130,12 +130,14 @@ FGPanelNode::drawImplementation(osg::State& state) const // coordinates to panel coordinates when the user clicks the // mouse. // OSGFIXME: we don't need that when we can really pick - const_cast(_lastModelview) = state.getModelViewMatrix(); - const_cast(_lastProjection) = state.getProjectionMatrix(); - state.getCurrentViewport()->getViewport(const_cast(_lastViewport[0]), - const_cast(_lastViewport[1]), - const_cast(_lastViewport[2]), - const_cast(_lastViewport[3])); + _lastModelview = state.getModelViewMatrix(); + _lastProjection = state.getProjectionMatrix(); + + const osg::Viewport* vp = state.getCurrentViewport(); + _lastViewport[0] = vp->x(); + _lastViewport[1] = vp->y(); + _lastViewport[2] = vp->width(); + _lastViewport[3] = vp->height(); _panel->draw(state); } diff --git a/src/Model/panelnode.hxx b/src/Model/panelnode.hxx index 85f83a0d3..0745e5d24 100644 --- a/src/Model/panelnode.hxx +++ b/src/Model/panelnode.hxx @@ -53,9 +53,9 @@ private: // The matrix transformation state that was active the last time // we were rendered. Used by the mouse code to compute // intersections. - osg::Matrix _lastModelview; - osg::Matrix _lastProjection; - int _lastViewport[4]; + mutable osg::Matrix _lastModelview; + mutable osg::Matrix _lastProjection; + mutable double _lastViewport[4]; };