2003-05-08 20:28:46 +00:00
|
|
|
|
// model.cxx - manage a 3D aircraft model.
|
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
|
//
|
|
|
|
|
// This file is in the Public Domain, and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
# include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <simgear/compiler.h>
|
|
|
|
|
|
2006-10-29 19:30:21 +00:00
|
|
|
|
#include <osg/Geode>
|
2003-05-08 20:28:46 +00:00
|
|
|
|
|
|
|
|
|
#include <simgear/props/props.hxx>
|
2003-05-09 20:40:59 +00:00
|
|
|
|
#include <simgear/scene/model/model.hxx>
|
2006-10-29 19:30:21 +00:00
|
|
|
|
#include <simgear/scene/util/SGNodeMasks.hxx>
|
2003-05-08 20:28:46 +00:00
|
|
|
|
|
|
|
|
|
#include "panelnode.hxx"
|
|
|
|
|
|
|
|
|
|
#include "model_panel.hxx"
|
|
|
|
|
|
|
|
|
|
SG_USING_STD(vector);
|
|
|
|
|
|
2004-04-02 14:41:35 +00:00
|
|
|
|
static
|
2006-10-29 19:30:21 +00:00
|
|
|
|
osg::Node* load_panel(SGPropertyNode *n)
|
2004-04-02 14:41:35 +00:00
|
|
|
|
{
|
2006-10-29 19:30:21 +00:00
|
|
|
|
osg::Geode* geode = new osg::Geode;
|
|
|
|
|
geode->addDrawable(new FGPanelNode(n));
|
|
|
|
|
return geode;
|
2004-04-02 14:41:35 +00:00
|
|
|
|
}
|
2006-10-29 19:30:21 +00:00
|
|
|
|
|
2003-05-08 20:28:46 +00:00
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Global functions.
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2006-10-29 19:30:21 +00:00
|
|
|
|
osg::Node *
|
2003-05-08 20:28:46 +00:00
|
|
|
|
fgLoad3DModelPanel( const string &fg_root, const string &path,
|
|
|
|
|
SGPropertyNode *prop_root,
|
2006-10-29 19:30:21 +00:00
|
|
|
|
double sim_time_sec, const SGPath& livery )
|
2003-05-08 20:28:46 +00:00
|
|
|
|
{
|
2006-10-29 19:30:21 +00:00
|
|
|
|
osg::Node* node = sgLoad3DModel( fg_root, path, prop_root, sim_time_sec,
|
|
|
|
|
load_panel, 0, livery );
|
|
|
|
|
node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
|
|
|
|
|
return node;
|
2003-05-08 20:28:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// end of model_panel.cxx
|