#include <osgDB/ReadFile>
#include <osgDB/SharedStateManager>
+#include <simgear/math/SGMath.hxx>
#include <simgear/scene/material/Effect.hxx>
#include <simgear/scene/material/EffectGeode.hxx>
#include <simgear/scene/util/SGSceneFeatures.hxx>
}
}
SplicingVisitor::apply(node);
+ // If a new node was created, copy the user data too.
+ ref_ptr<SGSceneUserData> userData = SGSceneUserData::getSceneUserData(&node);
+ if (userData.valid() && _childStack.back().back().get() != &node)
+ _childStack.back().back()->setUserData(new SGSceneUserData(*userData));
if (restoreEffect)
_currentEffectParent = savedEffectRoot;
}
} else {
eg = new EffectGeode;
eg->setEffect(effect);
+ ref_ptr<SGSceneUserData> userData = SGSceneUserData::getSceneUserData(&geode);
+ if (userData.valid())
+ eg->setUserData(new SGSceneUserData(*userData));
for (int i = 0; i < geode.getNumDrawables(); ++i)
eg->addDrawable(geode.getDrawable(i));
}