]> git.mxchange.org Git - flightgear.git/blob - src/Model/model_panel.cxx
tell *why* loading a model failed
[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/model.hxx>
16 #include <simgear/scene/util/SGNodeMasks.hxx>
17
18 #include "panelnode.hxx"
19
20 #include "model_panel.hxx"
21
22 SG_USING_STD(vector);
23
24 static
25 osg::Node* load_panel(SGPropertyNode *n)
26 {
27   osg::Geode* geode = new osg::Geode;
28   geode->addDrawable(new FGPanelNode(n));
29   return geode;
30 }
31
32 \f
33 ////////////////////////////////////////////////////////////////////////
34 // Global functions.
35 ////////////////////////////////////////////////////////////////////////
36
37 osg::Node *
38 fgLoad3DModelPanel( const string &fg_root, const string &path,
39                     SGPropertyNode *prop_root,
40                     double sim_time_sec, const SGPath& livery )
41 {
42   osg::Node* node = sgLoad3DModel( fg_root, path, prop_root, sim_time_sec,
43                                    load_panel, 0, livery );
44   node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
45   return node;
46 }
47
48
49 // end of model_panel.cxx