]> git.mxchange.org Git - flightgear.git/commitdiff
Helpers to clone SGModelData
authorThomas Geymayer <tomgey@gmail.com>
Mon, 1 Apr 2013 11:33:54 +0000 (13:33 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Mon, 1 Apr 2013 11:40:51 +0000 (13:40 +0200)
This is needed for latest SimGear to fix scene model
unload not being called

src/AIModel/AIBase.cxx
src/Scripting/NasalModelData.cxx
src/Scripting/NasalModelData.hxx

index 4db3e8f11edae8e09e3c75beb530ee1fa6e9019b..652524378b4c6b884fa7dda46ea2c68c85e3fdbb 100644 (file)
@@ -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)
     {
index 2181cb17f6b36ac8324ade2c6725892c9b73b7a3..2afd9c87d0499ac566d8b4fd680f154649c5c2bf 100644 (file)
@@ -31,7 +31,7 @@ typedef nasal::Ghost<NodeRef> 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();
index 8c8b13d6e1dd2e52f0996c414a7505aff25314e6..22ae536fe7820e957e759cb3936e58cf65b3b6e5 100644 (file)
@@ -89,6 +89,8 @@ public:
                       SGPropertyNode *prop,
                       osg::Node *branch );
     
+    virtual FGNasalModelDataProxy* clone() const { return new FGNasalModelDataProxy(_root); }
+
 protected:
     SGPropertyNode_ptr _root;
     FGNasalModelDataRef _data;