diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 85c27cbc2..b7dda6276 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -388,6 +388,9 @@ namespace Resource "Bip01 L Hand", "Bip01 R Hand", "Bip01 Head", "Bip01 Spine1", "Bip01 Spine2", "Bip01 L Clavicle", "Bip01 R Clavicle", "bip01", "Root Bone", "Bip01 Neck", "BoneOffset", "AttachLight", "ArrowBone", "Camera"}; reservedNames = std::set(reserved, reserved + sizeof(reserved)/sizeof(reserved[0])); + + for (unsigned int i=0; i(node)) { - osgParticle::ParticleSystemUpdater* cloned = osg::clone(updater, *this); + osgParticle::ParticleSystemUpdater* cloned = new osgParticle::ParticleSystemUpdater(*updater, osg::CopyOp::SHALLOW_COPY); mMap2[cloned] = updater->getParticleSystem(0); return cloned; } @@ -94,7 +94,7 @@ namespace SceneUtil osgParticle::ParticleProcessor* CopyOp::operator() (const osgParticle::ParticleProcessor* processor) const { - osgParticle::ParticleProcessor* cloned = osg::clone(processor, *this); + osgParticle::ParticleProcessor* cloned = osg::clone(processor, osg::CopyOp::SHALLOW_COPY); mMap[cloned] = processor->getParticleSystem(); return cloned; } diff --git a/components/sceneutil/optimizer.cpp b/components/sceneutil/optimizer.cpp index 1aadc19d6..99f7ae122 100644 --- a/components/sceneutil/optimizer.cpp +++ b/components/sceneutil/optimizer.cpp @@ -847,10 +847,11 @@ void Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes() pitr!=parents.end(); ++pitr) { + unsigned int childIndex = (*pitr)->getChildIndex(group); for (unsigned int i=0; igetNumChildren(); ++i) { osg::Node* child = group->getChild(i); - (*pitr)->addChild(child); + (*pitr)->insertChild(childIndex++, child); } (*pitr)->removeChild(group);