This is a fix for the handling of OpenFlight files with switches whose children 
have a transformation matrix on them. It may break other things and I have only 
tested this with one of my models.

------------------------
Tony V

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65954#65954



Index: src/osgPlugins/OpenFlight/Record.cpp
===================================================================
--- src/osgPlugins/OpenFlight/Record.cpp        (revision 15182)
+++ src/osgPlugins/OpenFlight/Record.cpp        (working copy)
@@ -84,14 +84,6 @@
     osg::ref_ptr<osg::Node> ref = &node;
     osg::Node::ParentList parents = node.getParents();
 
-    // Disconnect node from parents.
-    for (osg::Node::ParentList::iterator itr=parents.begin();
-        itr!=parents.end();
-        ++itr)
-    {
-        (*itr)->removeChild(&node);
-    }
-
     // Start without transformation if replication.
     osg::Matrix accumulatedMatrix = (numberOfReplications > 0)? 
osg::Matrix::identity() : matrix;
 
@@ -106,7 +98,7 @@
             itr!=parents.end();
             ++itr)
         {
-            (*itr)->addChild(transform.get());
+            (*itr)->replaceChild(&node, transform.get());
         }
 
         // Make primary a child of matrix transform.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to