From Tony Vasile, "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."

This commit is contained in:
Robert Osfield
2016-02-18 10:04:04 +00:00
parent 93b10f35c1
commit 08a1c45605

View File

@@ -12,7 +12,7 @@
*/
//
// OpenFlight<EFBFBD> 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<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 @@ 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.