]> git.mxchange.org Git - flightgear.git/blob - src/Model/model_panel.cxx
Initial commit of the new sound system, expect more updates to follow
[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
26 static
27 osg::Node* load_panel(SGPropertyNode *n)
28 {
29     osg::Geode* geode = new osg::Geode;
30     geode->addDrawable(new FGPanelNode(n));
31     return geode;
32 }
33
34 \f
35 ////////////////////////////////////////////////////////////////////////
36 // Global functions.
37 ////////////////////////////////////////////////////////////////////////
38
39 osg::Node *
40 fgLoad3DModelPanel(const string &path, SGPropertyNode *prop_root)
41 {
42     osg::Node* node = SGModelLib::loadModel(path, prop_root, load_panel);
43     if (node)
44         node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
45     return node;
46 }
47
48
49 // end of model_panel.cxx