]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/model_panel.cxx
Initial commit of the new sound system, expect more updates to follow
[flightgear.git] / src / Model / model_panel.cxx
index 732e0691a534ab293781ce0e37c57f0a33ec206c..eef538cb0a41c7b809e7e3a2078afdf3066c3090 100644 (file)
@@ -9,33 +9,40 @@
 
 #include <simgear/compiler.h>
 
-#include <plib/ssg.h>
+#include <osg/Geode>
 
 #include <simgear/props/props.hxx>
-#include <simgear/scene/model/model.hxx>
+#include <simgear/scene/model/modellib.hxx>
+#include <simgear/scene/util/SGNodeMasks.hxx>
+#include <simgear/math/SGMath.hxx>
 
 #include "panelnode.hxx"
-
 #include "model_panel.hxx"
 
-SG_USING_STD(vector);
+using std::vector;
+
+using namespace simgear;
 
 static
-ssgEntity *load_panel(SGPropertyNode *n)
+osg::Node* load_panel(SGPropertyNode *n)
 {
-  return new FGPanelNode(n);
+    osg::Geode* geode = new osg::Geode;
+    geode->addDrawable(new FGPanelNode(n));
+    return geode;
 }
+
 \f
 ////////////////////////////////////////////////////////////////////////
 // Global functions.
 ////////////////////////////////////////////////////////////////////////
 
-ssgBranch *
-fgLoad3DModelPanel( const string &fg_root, const string &path,
-                    SGPropertyNode *prop_root,
-                    double sim_time_sec )
+osg::Node *
+fgLoad3DModelPanel(const string &path, SGPropertyNode *prop_root)
 {
-  return sgLoad3DModel( fg_root, path, prop_root, sim_time_sec, load_panel );
+    osg::Node* node = SGModelLib::loadModel(path, prop_root, load_panel);
+    if (node)
+        node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
+    return node;
 }