]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/model_panel.cxx
Continuous replay: use correct replay duration
[flightgear.git] / src / Model / model_panel.cxx
index ea24a2fa2e0c6fb0d503b0b83cf387388fc004ee..a316243c1cf2ea22c376cdeea6a4fdf26535e7ef 100644 (file)
 #include <simgear/props/props.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
-osg::Node* load_panel(SGPropertyNode *n)
-{
-    osg::Geode* geode = new osg::Geode;
-    geode->addDrawable(new FGPanelNode(n));
-    return geode;
-}
-
 \f
 ////////////////////////////////////////////////////////////////////////
 // Global functions.
 ////////////////////////////////////////////////////////////////////////
 
 osg::Node *
-fgLoad3DModelPanel(const string &path, SGPropertyNode *prop_root)
+fgLoad3DModelPanel(const std::string &path, SGPropertyNode *prop_root)
 {
-    osg::Node* node = SGModelLib::loadModel(path, prop_root, load_panel);
-    node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
+    bool loadPanels = true;
+    osg::Node* node = SGModelLib::loadModel(path, prop_root, NULL, loadPanels);
+    if (node)
+        node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
     return node;
 }