1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Store the mag node in the viewer widget

This commit is contained in:
James Cotton 2012-03-19 22:36:08 -05:00
parent f4bd5a1c71
commit 33874402ea
2 changed files with 3 additions and 1 deletions

View File

@ -109,7 +109,7 @@ OsgViewerWidget::OsgViewerWidget(QWidget *parent) : QWidget(parent)
osg::Group* root = new osg::Group;
osg::Node* earth = osgDB::readNodeFile("/Users/jcotton81/Documents/Programming/osgearth/tests/boston.earth");
osgEarth::MapNode * mapNode = osgEarth::MapNode::findMapNode( earth );
mapNode = osgEarth::MapNode::findMapNode( earth );
if (!mapNode)
{
qDebug() <<"Uhoh";
@ -174,6 +174,7 @@ QWidget* OsgViewerWidget::createViewWidget( osg::Camera* camera, osg::Node* scen
//manip->setHomeViewpoint(Viewpoint("Boston", osg::Vec3d(-71.0763, 42.34425, 0), 24.261, -21.6, 3450.0));
manip->setTetherNode(uavPos);
osgQt::GraphicsWindowQt* gw = dynamic_cast<osgQt::GraphicsWindowQt*>( camera->getGraphicsContext() );
return gw ? gw->getGLWidget() : NULL;
}

View File

@ -109,6 +109,7 @@ private: /* Private variables */
EarthManipulator* manip;
osgEarth::Util::ObjectLocatorNode* uavPos;
osg::MatrixTransform* uavAttitudeAndScale;
osgEarth::MapNode* mapNode;
};