#include "NasalModelData.hxx"
#include "NasalSys.hxx"
+#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
+#include <osg/Transform>
+#include <osg/observer_ptr>
+
#include <simgear/math/SGMath.hxx>
#include <simgear/nasal/cppbind/Ghost.hxx>
#include <simgear/scene/util/OsgDebug.hxx>
#include <simgear/scene/util/OsgMath.hxx>
#include <simgear/debug/logstream.hxx>
-#include <osg/Transform>
-
#include <boost/bind.hpp>
#include <algorithm>
SG_INFO,
"New model with attached script(s) "
"(branch = " << branch << ","
- " path = " << simgear::getNodePathString(branch) <<
- " thread-safe = " << branch->getThreadSafeRefUnref() << ")"
+ " path = " << simgear::getNodePathString(branch) << ")"
);
}
(
SG_NASAL,
SG_INFO,
- "Removed model with script(s) (branch = " << _branch << ")"
+ "Removed model with script(s) (branch = " << _branch.get() << ")"
);
}
nasal::Hash module = nasalSys->getGlobals().createHash(_module);
module.set("_module_id", _module_id);
- if( !NasalNode::isInit() )
- {
- NasalNode::init("osg.Node")
+ NasalNode::init("osg.Node")
.method("getPose", &f_node_getPose);
- }
-
- module.set("_model", NodeRef(_branch));
+ module.set("_model", _branch);
naRef arg[2];
arg[0] = nasalSys->propNodeGhost(_root);
//------------------------------------------------------------------------------
osg::Node* FGNasalModelData::getNode()
{
- return _branch;
+ return _branch.get();
}
//------------------------------------------------------------------------------
SGPropertyNode *prop,
osg::Node *branch )
{
+ if( fgGetBool("/sim/disable-embedded-nasal") )
+ return;
+
if(!prop)
return;