From 8f1df6c3584f10b00ec305bea57ac9e324cddfff Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Mon, 1 Apr 2013 13:33:54 +0200 Subject: [PATCH] Helpers to clone SGModelData This is needed for latest SimGear to fix scene model unload not being called --- src/AIModel/AIBase.cxx | 2 ++ src/Scripting/NasalModelData.cxx | 2 +- src/Scripting/NasalModelData.hxx | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index 4db3e8f11..652524378 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -70,6 +70,8 @@ public: { } + virtual FGAIModelData* clone() const { return new FGAIModelData(); } + /** osg callback, thread-safe */ void modelLoaded(const std::string& path, SGPropertyNode *prop, osg::Node *n) { diff --git a/src/Scripting/NasalModelData.cxx b/src/Scripting/NasalModelData.cxx index 2181cb17f..2afd9c87d 100644 --- a/src/Scripting/NasalModelData.cxx +++ b/src/Scripting/NasalModelData.cxx @@ -31,7 +31,7 @@ typedef nasal::Ghost NasalNode; * model. */ static naRef f_node_getPose( const osg::Node& node, - const nasal::CallContext& ctx ) + const nasal::CallContext& ctx ) { osg::NodePathList parent_paths = node.getParentalNodePaths(); for( osg::NodePathList::const_iterator path = parent_paths.begin(); diff --git a/src/Scripting/NasalModelData.hxx b/src/Scripting/NasalModelData.hxx index 8c8b13d6e..22ae536fe 100644 --- a/src/Scripting/NasalModelData.hxx +++ b/src/Scripting/NasalModelData.hxx @@ -89,6 +89,8 @@ public: SGPropertyNode *prop, osg::Node *branch ); + virtual FGNasalModelDataProxy* clone() const { return new FGNasalModelDataProxy(_root); } + protected: SGPropertyNode_ptr _root; FGNasalModelDataRef _data; -- 2.39.5