]> git.mxchange.org Git - flightgear.git/blob - src/Model/model_panel.cxx
#738: crash when switching 2D panels
[flightgear.git] / src / Model / model_panel.cxx
1 // model.cxx - manage a 3D aircraft model.
2 // Written by David Megginson, started 2002.
3 //
4 // This file is in the Public Domain, and comes with no warranty.
5
6 #ifdef HAVE_CONFIG_H
7 #  include <config.h>
8 #endif
9
10 #include <simgear/compiler.h>
11
12 #include <osg/Geode>
13
14 #include <simgear/props/props.hxx>
15 #include <simgear/scene/model/modellib.hxx>
16 #include <simgear/scene/util/SGNodeMasks.hxx>
17 #include <simgear/math/SGMath.hxx>
18
19 #include "panelnode.hxx"
20 #include "model_panel.hxx"
21
22 using std::vector;
23
24 using namespace simgear;
25 \f
26 ////////////////////////////////////////////////////////////////////////
27 // Global functions.
28 ////////////////////////////////////////////////////////////////////////
29
30 osg::Node *
31 fgLoad3DModelPanel(const std::string &path, SGPropertyNode *prop_root)
32 {
33     bool loadPanels = true;
34     osg::Node* node = SGModelLib::loadModel(path, prop_root, NULL, loadPanels);
35     if (node)
36         node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
37     return node;
38 }
39
40
41 // end of model_panel.cxx