diff --git a/src/osgPlugins/OpenFlight/Record.cpp b/src/osgPlugins/OpenFlight/Record.cpp index a1e339ac9..0bc1cbc8d 100644 --- a/src/osgPlugins/OpenFlight/Record.cpp +++ b/src/osgPlugins/OpenFlight/Record.cpp @@ -12,7 +12,7 @@ */ // -// OpenFlightŪ loader for OpenSceneGraph +// OpenFlight loader for OpenSceneGraph // // Copyright (C) 2005-2007 Brede Johansen // @@ -84,14 +84,6 @@ void flt::insertMatrixTransform(osg::Node& node, const osg::Matrix& matrix, int osg::ref_ptr 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 @@ void flt::insertMatrixTransform(osg::Node& node, const osg::Matrix& matrix, int itr!=parents.end(); ++itr) { - (*itr)->addChild(transform.get()); + (*itr)->replaceChild(&node, transform.get()); } // Make primary a child of matrix transform.